summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorFabien Freling <fabien.freling@nokia.com>2010-11-25 16:21:12 (GMT)
committerFabien Freling <fabien.freling@nokia.com>2010-11-25 16:24:40 (GMT)
commit2ab77ea436c1ad1a35b0c8e2183aa78edbbe4765 (patch)
tree7928a5256adf12e8b65ed5e89f846fa7afe3e9ca /src/gui/kernel
parent6f5ed5836bd96b69d47aa3260118b3b49dddc82f (diff)
downloadQt-2ab77ea436c1ad1a35b0c8e2183aa78edbbe4765.zip
Qt-2ab77ea436c1ad1a35b0c8e2183aa78edbbe4765.tar.gz
Qt-2ab77ea436c1ad1a35b0c8e2183aa78edbbe4765.tar.bz2
Fix some memory leaks.
Update the retain/release mechanism for CGContexts. Some leaks were due to unnecessary retain calls. Task-number: QTBUG-15373 Reviewed-by: Samuel Rødal
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qcocoaview_mac.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/kernel/qcocoaview_mac.mm b/src/gui/kernel/qcocoaview_mac.mm
index d5363bd..e02cf11 100644
--- a/src/gui/kernel/qcocoaview_mac.mm
+++ b/src/gui/kernel/qcocoaview_mac.mm
@@ -554,6 +554,7 @@ static int qCocoaViewCount = 0;
}
CGContextRef cg = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
+ CGContextRetain(cg);
qwidgetprivate->hd = cg;
// We steal the CGContext for flushing in the unified toolbar with the raster engine.
@@ -653,6 +654,7 @@ static int qCocoaViewCount = 0;
}
qwidgetprivate->hd = 0;
CGContextRestoreGState(cg);
+ CGContextRelease(cg);
}
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent