Skip to content

Commit

Permalink
Fix a crash when flickering in onComplete
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteMasterEric committed Mar 13, 2024
1 parent 4d054bd commit edfaf85
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion flixel/effects/FlxFlicker.hx
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,12 @@ class FlxFlicker implements IFlxDestroyable
{
completionCallback(this);
}
release();

// NOTE: Calling `flicker` in the completion callback will call release() on this object before reinstantiating it.
// If that happens, we don't want to call release() again! So we check if the flicker is still done before releasing.
if (this.timer == Timer) {
release();
}
}
}

Expand Down

0 comments on commit edfaf85

Please sign in to comment.