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>bb10
parent
a6ffdbe30c
commit
38cf346bd7
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue