hiepnd/CCBlade — pull request #11 by Petrakeas (2012-10-15 01:00:28+00:00)
Title: Popping moved to "update:" method using dt timings + dealloc bug

Popping occurred inside draw method creating a lot of problems:
1. Didn't take into consideration dt timings. On slow devices (and simulator) the blade faded in slower rate
2. When CCDirector was paused, the blade faded in small steps (because of the framerate drop). What should have happened is that the drawing of the blade should have also paused.

Now popping takes place in a scheduled "update" method taking into consideration "dt" timing. The popping rate can also be change to different value than the default : 1/60.

A serious "dealloc" bug existed that sometimes resulted in crashes:
1. When [self clear] got called and _finish was "YES", then CCBlade instance would deallocate itself using "[self removeFromParentAndCleanup:YES];". Then (inside draw) the following line was evaluated:
if ([path count] < 3)
but path (instance variable) was already deallcoated!!
For some reason this did not always resulted in a crash, but sometimes it did.

FIX:
Now when CCBlade deallocates itsleft, the current method (draw or udpate) returns instantly.