aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-03 18:50:23 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-03 18:50:23 -0800
commita11bed277f11f0293e5e8df1ce735cf60f25fc4b (patch)
tree32e2823a76f338b7c4f3c8f9088de8c069e03505
parent95feb649fe2eee3fb8560d863cc48d5250de2417 (diff)
fix sdl shutdown crash
-rw-r--r--src/library_sdl.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index dcf71053..b2ca338b 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -707,7 +707,9 @@ var LibrarySDL = {
SDL_Quit: function() {
for (var i = 0; i < SDL.numChannels; ++i) {
- SDL.channels[i].audio.pause();
+ if (SDL.channels[i].audio) {
+ SDL.channels[i].audio.pause();
+ }
}
if (SDL.music.audio) {
SDL.music.audio.pause();