diff --git a/dist/spark/DevLauncher.mjs b/dist/spark/DevLauncher.mjs index 1e9319d0..ed81a7a0 100644 --- a/dist/spark/DevLauncher.mjs +++ b/dist/spark/DevLauncher.mjs @@ -30,6 +30,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 ba2e80ff..07a06379 100644 --- a/dist/spark/start.mjs +++ b/dist/spark/start.mjs @@ -8,4 +8,8 @@ sparkview.on('onKeyDown', function(e) { launcher._handleKey(e); }); -launcher.launch(App, {debug:false, h:sparkscene.h}, {useInspector: false}); +sparkscene.on('onClose', function(e) { + launcher._stopApp(); +}); + +launcher.launch(App, {debug:false, h:sparkscene.h}, {useInspector: false}); \ No newline at end of file