From 952a119ae16da8795785ca05a3f62ba7f5aee50b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 7 Aug 2013 21:41:24 +0200 Subject: IPHONE: Fix accidental double free. This was a copy&paste error. I also adapted the comment to be more clear. --- backends/platform/iphone/osys_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'backends/platform/iphone') 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(); } -- cgit v1.2.3