Mac: Fix crash on Mac OS 10.6 with new scrollbars.
Add missing runtime for OS X version in constructor. This ended up in a crash when starting a version compiled on 10.7 on 10.6. Change-Id: I25c5562ee905317554e79d83a2f5236ce9e2a145 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
This commit is contained in:
parent
ea6946318f
commit
770e1d30a2
@ -2107,25 +2107,29 @@ QMacStyle::QMacStyle()
|
||||
d = new QMacStylePrivate(this);
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
|
||||
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
|
||||
d->receiver = [[NotificationReceiver alloc] initWithPrivate:d];
|
||||
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
|
||||
|
||||
[[NSNotificationCenter defaultCenter] addObserver:receiver
|
||||
selector:@selector(scrollBarStyleDidChange:)
|
||||
name:NSPreferredScrollerStyleDidChangeNotification
|
||||
object:nil];
|
||||
[[NSNotificationCenter defaultCenter] addObserver:receiver
|
||||
selector:@selector(scrollBarStyleDidChange:)
|
||||
name:NSPreferredScrollerStyleDidChangeNotification
|
||||
object:nil];
|
||||
|
||||
d->nsscroller = [[NSScroller alloc] init];
|
||||
d->nsscroller = [[NSScroller alloc] init];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
QMacStyle::~QMacStyle()
|
||||
{
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
[d->nsscroller release];
|
||||
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
|
||||
[d->nsscroller release];
|
||||
|
||||
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:receiver];
|
||||
NotificationReceiver *receiver = static_cast<NotificationReceiver *>(d->receiver);
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:receiver];
|
||||
}
|
||||
#endif
|
||||
|
||||
delete qt_mac_backgroundPattern;
|
||||
|
Loading…
Reference in New Issue
Block a user