Cocoa Port: Fix a crash that can occur when taking a display window full screen while running macOS El Capitan. (Regression from commit ebc39eae.)

This commit is contained in:
rogerman 2022-05-15 08:21:29 -07:00
parent 07aefbd02c
commit 7cccf90976
1 changed files with 10 additions and 5 deletions

View File

@ -1391,15 +1391,20 @@ MacGPUFetchObjectDisplayLink::MacGPUFetchObjectDisplayLink()
DisplayLinkListUpdate();
CFNotificationCenterAddObserver(CFNotificationCenterGetLocalCenter(),
this,
ScreenChangeCallback,
CFSTR("NSApplicationDidChangeScreenParametersNotification"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
this,
ScreenChangeCallback,
CFSTR("NSApplicationDidChangeScreenParametersNotification"),
NULL,
CFNotificationSuspensionBehaviorDeliverImmediately);
}
MacGPUFetchObjectDisplayLink::~MacGPUFetchObjectDisplayLink()
{
CFNotificationCenterRemoveObserver(CFNotificationCenterGetLocalCenter(),
this,
CFSTR("NSApplicationDidChangeScreenParametersNotification"),
NULL);
pthread_mutex_lock(&this->_mutexDisplayLinkLists);
while (this->_displayLinksActiveList.size() > 0)