From f69bc6ea4982ee0820378b2b5f21e6e268cac76c Mon Sep 17 00:00:00 2001 From: Madana Gopal Date: Thu, 22 Aug 2019 12:11:26 +0530 Subject: [PATCH] changes for cleaning up objects after app exit --- dist/spark/DevLauncher.mjs | 5 +++++ dist/spark/start.mjs | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dist/spark/DevLauncher.mjs b/dist/spark/DevLauncher.mjs index d7ac82c3..25222928 100644 --- a/dist/spark/DevLauncher.mjs +++ b/dist/spark/DevLauncher.mjs @@ -34,6 +34,11 @@ export default class DevLauncher { this._ui.startApp(this._appType); } + _stopApp() { + this._ui.destroy(); + this._ui = null; + } + _loadInspector() { if (this._options.useInspector) { /* Attach the inspector to create a fake DOM that shows where lightning elements can be found. */ diff --git a/dist/spark/start.mjs b/dist/spark/start.mjs index f82b27fc..197d0df4 100644 --- a/dist/spark/start.mjs +++ b/dist/spark/start.mjs @@ -8,4 +8,8 @@ sparkview.on('onKeyDown', function(e) { launcher._handleKey(e); }); +sparkscene.on('onClose', function(e) { + launcher._stopApp(); +}); + launcher.launch(App, {debug:false}, {useInspector: false});