Seg fault on Canvas update