summaryrefslogtreecommitdiff
path: root/platform/javascript/engine
diff options
context:
space:
mode:
Diffstat (limited to 'platform/javascript/engine')
-rw-r--r--platform/javascript/engine/engine.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/platform/javascript/engine/engine.js b/platform/javascript/engine/engine.js
index adcd919a6b..05a11701c0 100644
--- a/platform/javascript/engine/engine.js
+++ b/platform/javascript/engine/engine.js
@@ -121,6 +121,7 @@ Function('return this')()['Engine'] = (function() {
me.rtenv['noExitRuntime'] = true;
me.rtenv['onExecute'] = me.onExecute;
me.rtenv['onExit'] = function(code) {
+ me.rtenv['deinitFS']();
if (me.onExit)
me.onExit(code);
me.rtenv = null;
@@ -227,6 +228,12 @@ Function('return this')()['Engine'] = (function() {
this.persistentPaths = persistentPaths;
};
+ Engine.prototype.requestQuit = function() {
+ if (this.rtenv) {
+ this.rtenv['request_quit']();
+ }
+ };
+
// Closure compiler exported engine methods.
/** @export */
Engine['isWebGLAvailable'] = Utils.isWebGLAvailable;
@@ -249,5 +256,6 @@ Function('return this')()['Engine'] = (function() {
Engine.prototype['setOnExit'] = Engine.prototype.setOnExit;
Engine.prototype['copyToFS'] = Engine.prototype.copyToFS;
Engine.prototype['setPersistentPaths'] = Engine.prototype.setPersistentPaths;
+ Engine.prototype['requestQuit'] = Engine.prototype.requestQuit;
return Engine;
})();