aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-07 21:41:24 +0200
committerJohannes Schickel2013-08-07 21:41:24 +0200
commit952a119ae16da8795785ca05a3f62ba7f5aee50b (patch)
tree91c82312d3a2807c711e5d02fccd8d02491e3d2a
parent7f8308e0eb50c4e13ec0684619b5474983a93a66 (diff)
downloadscummvm-rg350-952a119ae16da8795785ca05a3f62ba7f5aee50b.tar.gz
scummvm-rg350-952a119ae16da8795785ca05a3f62ba7f5aee50b.tar.bz2
scummvm-rg350-952a119ae16da8795785ca05a3f62ba7f5aee50b.zip
IPHONE: Fix accidental double free.
This was a copy&paste error. I also adapted the comment to be more clear.
-rw-r--r--backends/platform/iphone/osys_main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/platform/iphone/osys_main.cpp b/backends/platform/iphone/osys_main.cpp
index ea566c3da0..a814495b80 100644
--- a/backends/platform/iphone/osys_main.cpp
+++ b/backends/platform/iphone/osys_main.cpp
@@ -77,8 +77,8 @@ OSystem_IPHONE::~OSystem_IPHONE() {
delete _mixer;
// Prevent accidental freeing of the screen texture here. This needs to be
// checked since we might use the screen texture as framebuffer in the case
- // of hi-color games for example.
- if (_framebuffer.getPixels() == _videoContext->screenTexture.getPixels())
+ // of hi-color games for example. Otherwise this can lead to a double free.
+ if (_framebuffer.getPixels() != _videoContext->screenTexture.getPixels())
_framebuffer.free();
_mouseBuffer.free();
}