Use __block rather than __weak since we are in manual ref counting regime
This commit is contained in:
parent
a9e71e5b5b
commit
a4a7f77ef1
2 changed files with 4 additions and 2 deletions
|
|
@ -453,8 +453,9 @@ - (void)observeValueForKeyPath:(NSString *)keyPath
|
|||
if ([keyPath isEqualToString:@"effectiveAppearance"]) {
|
||||
// The initial call (from NSKeyValueObservingOptionInitial) might happen on a background thread.
|
||||
// Dispatch to the main thread to be safe, especially if updating UI.
|
||||
__block __typeof__(self) weakSelf = self;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self handleAppearanceChange];
|
||||
[weakSelf handleAppearanceChange];
|
||||
});
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -2330,8 +2330,9 @@ void _glfwPlatformShowWindow(_GLFWwindow* window, bool move_to_active_screen)
|
|||
NSWindowCollectionBehavior old = nw.collectionBehavior;
|
||||
nw.collectionBehavior = (old & !NSWindowCollectionBehaviorCanJoinAllSpaces) | NSWindowCollectionBehaviorMoveToActiveSpace;
|
||||
[nw orderFront:nil];
|
||||
__block __typeof__(nw) weakSelf = nw;
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
nw.collectionBehavior = old;
|
||||
weakSelf.collectionBehavior = old;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue