diff options
author | Felix H. Dahlke <fhd@ubercode.de> | 2013-07-25 09:43:00 +0200 |
---|---|---|
committer | Felix H. Dahlke <fhd@ubercode.de> | 2013-07-25 09:43:30 +0200 |
commit | 36aa6eb6c7fd6acfb04a9f7467b8ca1974a07dcd (patch) | |
tree | 02f28c8f244095fcd49a8f3d532f391b4d465fcb /src/library_sdl.js | |
parent | da350fac54cccf6f511aa4cbb4f8bedae6b606df (diff) |
Don't leak the last surface and improve SDL_surface refcount test
Diffstat (limited to 'src/library_sdl.js')
-rw-r--r-- | src/library_sdl.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js index ee62139c..34484a0e 100644 --- a/src/library_sdl.js +++ b/src/library_sdl.js @@ -365,7 +365,7 @@ var LibrarySDL = { freeSurface: function(surf) { var refcountPointer = surf + Runtime.QUANTUM_SIZE * 14; var refcount = {{{ makeGetValue('refcountPointer', '0', 'i32') }}}; - if (refcount > 0) { + if (refcount > 1) { {{{ makeSetValue('refcountPointer', '0', 'refcount - 1', 'i32') }}}; return; } |