1. Perry Metzger
  2. growl


Peter Hosey  committed 507967d

Burninate use of KVO by GrowlDisplayWindowController to observe its bridge's notification.

This is totally unnecessary and causes memory-management problems. Fixes the crash introduced by the leak fix (previous change).

  • Participants
  • Parent commits cd1d446
  • Branches default

Comments (0)

Files changed (1)

File Plugins/Displays/GrowlDisplayWindowController.m

View file
 - (void) dealloc {
 	[self setDelegate:nil];
-	[[self bridge] removeObserver:self forKeyPath:@"notification"];
 	[[NSNotificationCenter defaultCenter] removeObserver:self];
 	[self stopAllTransitions];
 	if (bridge != theBridge) {
 		if (bridge) {
 			NSLog(@"*** This may be an error. %@ had its bridge reset", self);
-			[bridge removeObserver:self forKeyPath:@"notification"];
 		//Do not retain! The bridge owns us; retaining the bridge here is a mutual retention—i.e., a leak.
 		bridge = theBridge;
-		[bridge addObserver:self forKeyPath:@"notification" options:NSKeyValueObservingOptionNew context:NULL];
-		[self observeValueForKeyPath:@"notification" ofObject:bridge change:nil context:NULL];
-	}
-- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
-#pragma unused(change)
-#pragma unused(context)
-	if ((object == bridge) &&
-		[keyPath isEqualToString:@"notification"]) {
 		[self setNotification:[bridge notification]];