1. lawrence3526
  2. growl

Commits

Peter Hosey  committed 18c0b5b

Committing some code to log a message whenever a bridge gets deallocated, in order to help debug #157.

  • Participants
  • Parent commits 8da49fc
  • Branches maintenance-1.2

Comments (0)

Files changed (1)

File Plugins/Displays/GrowlNotificationDisplayBridge.m

View file
 
 #import "GrowlDisplayWindowController.h"
 
+#include <execinfo.h>
+
 //Used to silence a warning when forwarding one of these messages to the display or notification.
 @protocol WindowControllerListener <NSObject>
 
 }
 
 - (void) dealloc {
+	{
+		enum { maxStackHeight = 64 };
+		void *stackAddresses[maxStackHeight];
+		int numAddresses = backtrace(stackAddresses, maxStackHeight);
+		char **symbolsUTF8 = backtrace_symbols(stackAddresses, numAddresses);
+		NSMutableArray *stackTraceSymbols = [NSMutableArray arrayWithCapacity:numAddresses];
+		for (int i = 0; i < numAddresses; ++i) {
+			[stackTraceSymbols addObject:[NSString stringWithUTF8String:symbolsUTF8[i]]];
+		}
+		NSLog(@"%@ deallocating; stack trace:\n%@\n"@"window controllers: %@", self, stackTraceSymbols, windowControllers);
+		free(symbolsUTF8);
+	}
 	[windowControllers release];
 
 	[notification release];