Skip to content

Commit

Permalink
Properly destroy FlxUIList (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
Starmapo authored Oct 16, 2023
1 parent dc4aec5 commit edb5092
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions flixel/addons/ui/FlxUIList.hx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import flixel.FlxObject;
import flixel.FlxSprite;
import flixel.ui.FlxButton;
import flixel.math.FlxPoint;
import flixel.util.FlxDestroyUtil;

class FlxUIList extends FlxUIGroup
{
Expand Down Expand Up @@ -184,12 +185,10 @@ class FlxUIList extends FlxUIGroup

public override function destroy():Void
{
prevButton = null;
nextButton = null;
prevButtonOffset.put();
nextButtonOffset.put();
prevButtonOffset = null;
nextButtonOffset = null;
prevButton = FlxDestroyUtil.destroy(prevButton);
nextButton = FlxDestroyUtil.destroy(nextButton);
prevButtonOffset = FlxDestroyUtil.put(prevButtonOffset);
nextButtonOffset = FlxDestroyUtil.put(nextButtonOffset);
super.destroy();
}

Expand Down

0 comments on commit edb5092

Please sign in to comment.