diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2010-11-25 17:21:12 +0100 |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2010-11-25 17:24:40 +0100 |
commit | 2ab77ea436c1ad1a35b0c8e2183aa78edbbe4765 (patch) | |
tree | 7928a5256adf12e8b65ed5e89f846fa7afe3e9ca /src/gui/painting/qwindowsurface_raster.cpp | |
parent | 6f5ed5836bd96b69d47aa3260118b3b49dddc82f (diff) |
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 ae73d7d631..2b4e12521e 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 |