[Kde-games-devel] [Patch] Fix crash in kolf

Albert Astals Cid aacid at kde.org
Sun Dec 23 17:36:19 CET 2007


A Diumenge 23 Desembre 2007, Christian Ehrlicher va escriure:
> Hi,
>
> I found a crash in kolf and also fixed the problem for. But I'm unsure
> if this is the crrect fix.
>
> How to reproduce: Start a new game, hit the ball at least once (to make
> sure Ball::collisionDetect() is called). End the game and stat a new
> one. The next time you hit the ball, you'll get a crash because
> 'QGraphicsEllipseItem* halo' is != 0 but already deleted.
> halo is deleted when it's parent is destroyed but the variable is not
> reset to 0.
> For me it looks like the static is not needed at all.

It seems to be somewhat an optimization not to create the hallo each time, for 
me the right thing would be making halo a member of the ball.

What do you say Paul?

Albert

>
>
> Christian




More information about the kde-games-devel mailing list