Hoist the retention of the bridge out of the condition. I *think* this fixes the displayWindowControllerDidTakeDownWindow: crash for queueing displays. Fixes #157. maintenance-1.2
authorPeter Hosey <hg@boredzo.org>
Fri Dec 31 02:38:44 2010 -0800 (2010-12-31)
branchmaintenance-1.2
changeset 4662d20656831049
parent 4661 dfd0e87a3029
child 4663 3b5dfdebead3
Hoist the retention of the bridge out of the condition. I *think* this fixes the displayWindowControllerDidTakeDownWindow: crash for queueing displays. Fixes #157.
Plugins/Displays/GrowlDisplayPlugin.m
     1.1 --- a/Plugins/Displays/GrowlDisplayPlugin.m	Sat Sep 11 13:26:12 2010 -0700
     1.2 +++ b/Plugins/Displays/GrowlDisplayPlugin.m	Fri Dec 31 02:38:44 2010 -0800
     1.3 @@ -137,6 +137,9 @@
     1.4  	GrowlNotificationDisplayBridge *theBridge;
     1.5  
     1.6  	[wc retain];
     1.7 +	//Keep the bridge alive for the life of this pool, in case it would otherwise die here before we ask it for its notification's coalescing identifier in the next compound statement.
     1.8 +	GrowlNotificationDisplayBridge *bridgeFromWC = [[[wc bridge] retain] autorelease];
     1.9 +
    1.10  
    1.11  	if(queue)
    1.12  	{
    1.13 @@ -158,14 +161,13 @@
    1.14  			bridge = nil;
    1.15  		}
    1.16  	} else {
    1.17 -		//Keep the bridge alive for the life of this pool, in case it would otherwise die here before we ask it for its notification's coalescing identifier in the next compound statement.
    1.18 -		theBridge = [[[wc bridge] retain] autorelease];
    1.19 +		theBridge = bridgeFromWC;
    1.20  		[theBridge removeWindowController:wc];
    1.21  		[activeBridges removeObjectIdenticalTo:theBridge];
    1.22  	}
    1.23  
    1.24  	if (coalescableBridges) {
    1.25 -		NSString *identifier = [[[[wc bridge] notification] auxiliaryDictionary] objectForKey:GROWL_NOTIFICATION_IDENTIFIER];
    1.26 +		NSString *identifier = [[[bridgeFromWC notification] auxiliaryDictionary] objectForKey:GROWL_NOTIFICATION_IDENTIFIER];
    1.27  		if (identifier)
    1.28  			[coalescableBridges removeObjectForKey:identifier];
    1.29  	}