Fix retain cycle.

Fixes #1009.
This commit is contained in:
Allan Odgaard
2013-06-09 21:55:22 +08:00
parent c8d249dde7
commit db97493459

View File

@@ -2279,7 +2279,7 @@ static NSUInteger DisableSessionSavingCount = 0;
{
if([NSApp isHidden])
{
__block id observerId = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidUnhideNotification object:NSApp queue:nil usingBlock:^(NSNotification*){
__weak __block id observerId = [[NSNotificationCenter defaultCenter] addObserverForName:NSApplicationDidUnhideNotification object:NSApp queue:nil usingBlock:^(NSNotification*){
[aController showWindow:nil];
SetFrontProcessWithOptions(&(ProcessSerialNumber){ 0, kCurrentProcess }, kSetFrontProcessFrontWindowOnly);
[[NSNotificationCenter defaultCenter] removeObserver:observerId];