Skip to content

Commit

Permalink
Merge pull request #68488 from dsnopek/master-webxr-no-exit-runtime
Browse files Browse the repository at this point in the history
Fix WebXR after changing Emscripten configuration noExitRuntime to false
  • Loading branch information
Faless authored Nov 14, 2022
2 parents 315c642 + a17e93c commit aa4c286
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/webxr/native/library_godot_webxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
const GodotWebXR = {
$GodotWebXR__deps: ['$Browser', '$GL', '$GodotRuntime'],
$GodotWebXR__deps: ['$Browser', '$GL', '$GodotRuntime', '$runtimeKeepalivePush', '$runtimeKeepalivePop'],
$GodotWebXR: {
gl: null,

Expand Down Expand Up @@ -69,7 +69,9 @@ const GodotWebXR = {
// gets picked up automatically, however, in the Oculus Browser
// on the Quest, we need to pause and resume the main loop.
Browser.mainLoop.pause();
runtimeKeepalivePush(); // eslint-disable-line no-undef
window.setTimeout(function () {
runtimeKeepalivePop(); // eslint-disable-line no-undef
Browser.mainLoop.resume();
}, 0);
},
Expand Down

0 comments on commit aa4c286

Please sign in to comment.