diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2012-10-03 13:50:02 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-04 12:14:15 +0200 |
commit | 65f6ad26ed167b9baf0e63ba0b36f56a3de9c635 (patch) | |
tree | 4a0689d7b290b120fd3ab32cdeecf4e9bd00d90b /src | |
parent | bf55c0ac3b9c4ab8ab900ebdf2347faa1f17e12b (diff) |
Mac: Safely dispose of scrollbars temporary NSGraphicsContext
When rendering transient scrollbars, we instanciate a specialised
NSGraphicsContext since those need non-opaque rendering. This context
is being used as current context, but it was never properly released
and the previous context never properly restored.
Task-number: QTBUG-27327
Change-Id: I4e867e64a09368dbe64b84b17f07fd8e57bbae24
Reviewed-by: Teemu Katajisto <teemu.katajisto@digia.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 65a39ba304..585e510dd3 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -5152,6 +5152,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex } CGContextSaveGState(cg); + [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]]; @@ -5230,6 +5231,8 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex } CGContextEndTransparencyLayer(cg); + + [NSGraphicsContext restoreGraphicsState]; CGContextRestoreGState(cg); } else #endif |