macOS: Don't capture local Q_D in QMacStyle

Change-Id: I01f14295e7e383b583931fc22e3d43151f7918b0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Tor Arne Vestbø 2019-06-19 16:42:35 +02:00
parent fe6e54fb1f
commit 25eb0408a6

View File

@ -2061,7 +2061,8 @@ QMacStyle::QMacStyle()
Q_D(QMacStyle); Q_D(QMacStyle);
// FIXME: Tie this logic into theme change, or even polish/unpolish // FIXME: Tie this logic into theme change, or even polish/unpolish
if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave) { if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave) {
d->appearanceObserver = QMacKeyValueObserver(NSApp, @"effectiveAppearance", [&d] { d->appearanceObserver = QMacKeyValueObserver(NSApp, @"effectiveAppearance", [this] {
Q_D(QMacStyle);
for (NSView *b : d->cocoaControls) for (NSView *b : d->cocoaControls)
[b release]; [b release];
d->cocoaControls.clear(); d->cocoaControls.clear();