diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-10-29 13:31:13 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-10-29 13:39:10 -0700 |
commit | 8a1294ec809cdfd90d17cc6c0ba04525d5d4909e (patch) | |
tree | 0c2ae52db4b73456c47f0e0190eff31d69b067fc /src | |
parent | b30283324ee657a14115b4df6620717b2b32a12c (diff) |
only fire sdl unload event if there is a main loop
Diffstat (limited to 'src')
-rw-r--r-- | src/library_sdl.js | 8 |
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); |