diff options
author | Teemu Katajisto <teemu.katajisto@digia.com> | 2012-10-17 15:42:06 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-19 00:44:54 +0200 |
commit | 3ebee851b29e724dfb5fda7f057d105b0b0fa9ba (patch) | |
tree | 849340fc7afa6375e56c96f88b8eb4eeea45b866 /src/plugins | |
parent | 0a7e6c5856b26fb5d74919bceb2778fe5c0dc713 (diff) |
Cocoa: fix memory leak
Release the created CGImageRef.
Change-Id: If3b36b636ae1302b8a63bbae7285a6461b993f62
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoahelpers.mm | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index 743c78ed05..bd89f26fca 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -135,7 +135,10 @@ NSImage *qt_mac_cgimage_to_nsimage(CGImageRef image) NSImage *qt_mac_create_nsimage(const QPixmap &pm) { QImage image = pm.toImage(); - return qt_mac_cgimage_to_nsimage(qt_mac_image_to_cgimage(image)); + CGImageRef cgImage = qt_mac_image_to_cgimage(image); + NSImage *nsImage = qt_mac_cgimage_to_nsimage(cgImage); + CGImageRelease(cgImage); + return nsImage; } HIMutableShapeRef qt_mac_QRegionToHIMutableShape(const QRegion ®ion) |