From 82ec709831a9d52f6ddec6a5af33d012e44fff08 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 10 Apr 2023 12:43:25 -0700 Subject: [PATCH] Application: on exit, clear Application.current if it is equal to this This matches setting Application.current in the constructor, and helps avoid memory leaks --- src/lime/app/Application.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lime/app/Application.hx b/src/lime/app/Application.hx index 5693a1914..6197d1f2d 100644 --- a/src/lime/app/Application.hx +++ b/src/lime/app/Application.hx @@ -591,6 +591,10 @@ class Application extends Module @:noCompletion private function __onModuleExit(code:Int):Void { __backend.exit(); + if (Application.current == this) + { + Application.current = null; + } } @:noCompletion private function __onWindowClose(window:Window):Void