diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2010-11-25 16:21:12 (GMT) |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2010-11-25 16:24:40 (GMT) |
commit | 2ab77ea436c1ad1a35b0c8e2183aa78edbbe4765 (patch) | |
tree | 7928a5256adf12e8b65ed5e89f846fa7afe3e9ca /src/gui/painting/qwindowsurface_raster.cpp | |
parent | 6f5ed5836bd96b69d47aa3260118b3b49dddc82f (diff) | |
download | Qt-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/painting/qwindowsurface_raster.cpp')
-rw-r--r-- | src/gui/painting/qwindowsurface_raster.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/painting/qwindowsurface_raster.cpp b/src/gui/painting/qwindowsurface_raster.cpp index ae73d7d..2b4e125 100644 --- a/src/gui/painting/qwindowsurface_raster.cpp +++ b/src/gui/painting/qwindowsurface_raster.cpp @@ -285,6 +285,7 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi extern CGContextRef qt_mac_graphicsContextFor(QWidget *); CGContextRef context = qt_mac_graphicsContextFor(widget); #endif + CGContextRetain(context); CGContextSaveGState(context); // Flip context. @@ -317,6 +318,8 @@ void QRasterWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoi // Restore context. CGContextRestoreGState(context); + CGContextRelease(context); + #endif // Q_WS_MAC |