diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-10-07 11:19:01 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-10-07 11:29:45 +0200 |
commit | 38cf346bd70de6aaabfbf66ba159919591ce9098 (patch) | |
tree | 85577cf369b6148a4ea6bac6725953089cc980f0 /src/plugins/styles | |
parent | a6ffdbe30c49fa1ede0d147531b89d121d00fa94 (diff) |
QMacStyle::drawControl - lift the pool declaration
out of switch/case - can help in case some NSControl is using autorelease
and an application is calling drawControl too often.
Fixes: QTBUG-78761
Change-Id: I2b55d533f52db16703dcc965920f4316fdf76734
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index b2bcdb3e5b..0a216e540d 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3462,6 +3462,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter { Q_D(const QMacStyle); const AppearanceSync sync; + const QMacAutoReleasePool pool; QMacCGContext cg(p); QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr; d->resolveCurrentNSView(window); @@ -4326,7 +4327,6 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter break; case CE_ProgressBarContents: if (const QStyleOptionProgressBar *pb = qstyleoption_cast<const QStyleOptionProgressBar *>(opt)) { - QMacAutoReleasePool pool; const bool isIndeterminate = (pb->minimum == 0 && pb->maximum == 0); const bool vertical = pb->orientation == Qt::Vertical; const bool inverted = pb->invertedAppearance; |