diff options
author | Dyami Caliri <dyami@dragonframe.com> | 2014-10-09 15:25:07 -0700 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2014-10-13 13:53:24 +0200 |
commit | 2b4cda3852cf92fdff3ce4956f8752a99e44cf56 (patch) | |
tree | e6bc2101f303d7ef8f9ebcc93479ca8b4ed4f56f /src/widgets | |
parent | 26fbeecfa55ee3250c81da6d2e14567ec2051e23 (diff) |
QMacStyle: save context state before changing to avoid crash
qt_drawFocusRingOnPath was saving the graphics state after setting
a new context. This leads to zombie NSBitmapGraphicsContext access
with QFileDialog.
Task-number: QTBUG-41879
Change-Id: I7fc7d959d2b0f01cb3491d639023083f1b46d175
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 70daafc88c..db971eba1b 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -1102,9 +1102,9 @@ static QAquaWidgetSize qt_aqua_guess_size(const QWidget *widg, QSize large, QSiz static void qt_drawFocusRingOnPath(CGContextRef cg, NSBezierPath *focusRingPath) { CGContextSaveGState(cg); + [NSGraphicsContext saveGraphicsState]; [NSGraphicsContext setCurrentContext:[NSGraphicsContext graphicsContextWithGraphicsPort:(CGContextRef)cg flipped:NO]]; - [NSGraphicsContext saveGraphicsState]; NSSetFocusRingStyle(NSFocusRingOnly); [focusRingPath setClip]; // Clear clip path to avoid artifacts when rendering the cursor at zero pos [focusRingPath fill]; |