diff options
author | Andy Shaw <andy.shaw@digia.com> | 2013-01-31 09:18:59 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-13 10:00:28 (GMT) |
commit | c03d47e9277a922886d84a0005e5cf7a75d3398b (patch) | |
tree | 2e284b674a50024960549c862261d984d1deac03 /src | |
parent | 245af0433dd540dae8c73ac97eb77096a4405e68 (diff) | |
download | Qt-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>
Diffstat (limited to 'src')
-rwxr-xr-x | src/gui/image/qpixmap_mac.cpp | 2 |
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); |