summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@digia.com>2013-01-31 09:18:59 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-02-13 10:00:28 (GMT)
commitc03d47e9277a922886d84a0005e5cf7a75d3398b (patch)
tree2e284b674a50024960549c862261d984d1deac03
parent245af0433dd540dae8c73ac97eb77096a4405e68 (diff)
downloadQt-c03d47e9277a922886d84a0005e5cf7a75d3398b.zip
Qt-c03d47e9277a922886d84a0005e5cf7a75d3398b.tar.gz
Qt-c03d47e9277a922886d84a0005e5cf7a75d3398b.tar.bz2
Ensure that pixels is only freed if there was no CGImage for it
If there was a CGImage that was using the same pixel data then when it is released it will also free the pixel data. So don't release it a second time in that case. Change-Id: I7d0f3fcbaeb137328acc71783be4e4cee33ce001 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
-rwxr-xr-xsrc/gui/image/qpixmap_mac.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index 32f75c5..5923e24 100755
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -528,7 +528,7 @@ QMacPixmapData::~QMacPixmapData()
if (cg_data) {
CGImageRelease(cg_data);
}
- if (pixels && (pixels != pixelsToFree))
+ else if (pixels && (pixels != pixelsToFree))
free(pixels);
if (pixelsToFree)
free(pixelsToFree);