From 8209c4d25029da56c88a1bd9412cd637801d4100 Mon Sep 17 00:00:00 2001 From: Ian Harrigan Date: Tue, 19 Dec 2023 08:49:36 +0100 Subject: [PATCH] .state ref should only be nulled if component is being disposed --- haxe/ui/backend/ScreenImpl.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/haxe/ui/backend/ScreenImpl.hx b/haxe/ui/backend/ScreenImpl.hx index f9fe7d6..9cdc515 100644 --- a/haxe/ui/backend/ScreenImpl.hx +++ b/haxe/ui/backend/ScreenImpl.hx @@ -213,6 +213,7 @@ class ScreenImpl extends ScreenBase { throw "component wasnt actually removed from array, or there is a duplicate in the array"; } if (dispose) { + component.state = null; component.destroyInternal(); component.destroy(); component.destroyComponent(); @@ -222,7 +223,6 @@ class ScreenImpl extends ScreenBase { if (StateHelper.currentState.exists == true) { StateHelper.currentState.remove(component, true); } - component.state = null; checkResetCursor(); onContainerResize(); return component;