aboutsummaryrefslogtreecommitdiff
path: root/src/library_sdl.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r--src/library_sdl.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index a77a4668..608f1738 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -418,9 +418,11 @@ var LibrarySDL = {
}
break;
case 'unload':
- SDL.events.push(event);
- // Force-run a main event loop, since otherwise this event will never be caught!
- Browser.mainLoop.runner();
+ if (Browser.mainLoop.runner) {
+ SDL.events.push(event);
+ // Force-run a main event loop, since otherwise this event will never be caught!
+ Browser.mainLoop.runner();
+ }
return true;
case 'resize':
SDL.events.push(event);