diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-03-28 11:04:35 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-03-28 11:04:35 -0700 |
commit | a4a85b72ed016b2d652a8a4abe15f58fb15a5b7d (patch) | |
tree | 505e4b441b20b2ae25a5ea45a5c255bfd1adaec6 /src | |
parent | efe2cd8048793dc16db6c42d427591f08f9b7f3a (diff) |
fix SDL bug where freeing the surface screen did not work properly
Diffstat (limited to 'src')
-rw-r--r-- | src/library_sdl.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index 3d96a693..d90484ad 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -411,6 +411,10 @@ var LibrarySDL = { _free(info.pixelFormat); _free(surf); SDL.surfaces[surf] = null; + + if (surf === SDL.screen) { + SDL.screen = null; + } }, touchX: 0, touchY: 0, @@ -1036,7 +1040,7 @@ var LibrarySDL = { // Free the old surface first. if (SDL.screen) { SDL.freeSurface(SDL.screen); - SDL.screen = null; + assert(!SDL.screen); } SDL.screen = SDL.makeSurface(width, height, flags, true, 'screen'); if (!SDL.addedResizeListener) { |