From 6e8fb70d0405d9c000c0cc6c81279821fa45c98a Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 10 Oct 2022 13:27:33 -0700 Subject: [PATCH] Application: extract the auto exit behavior into a separate method from __removeWindow() This will allow OpenFL to override the behavior based on the NativeApplication class. --- src/lime/app/Application.hx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/lime/app/Application.hx b/src/lime/app/Application.hx index 0cdf4d3e7..b8a5b2bc3 100644 --- a/src/lime/app/Application.hx +++ b/src/lime/app/Application.hx @@ -549,12 +549,17 @@ class Application extends Module __windowByID.remove(window.id); window.close(); - if (__windows.length == 0) - { - #if !lime_doc_gen - System.exit(0); - #end - } + __checkForAllWindowsClosed(); + } + } + + @:noCompletion private function __checkForAllWindowsClosed():Void + { + if (__windows.length == 0) + { + #if !lime_doc_gen + System.exit(0); + #end } }