There's a mem leak in the Growl 1.1.x Framwork. Every time a notification is sent, several bytes are leaked (in my case 64). Using Malloc Debug, I tracked it down to + (NSDictionary *) [GrowlApplicationBridge registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys ]
That method forgets to release mRegDict before returning. 0.7.6 does not leak and looking at the code it was because the dict was released:
>>> 1.1.1
return mRegDict;
<<<< 0.7.6
NSDictionary *result = [NSDictionary dictionaryWithDictionary:mRegDict];
[mRegDict release];
return result;
>>>
I confirmed this by using the 0.7.6 framework in my app and and then running it under Malloc Debug - no more leaks.
Bug: Memory leak in 1.1.x Framework
- evands
- Cocoaforge Admin
- Posts: 3152
- Joined: Thu Dec 02, 2004 10:55 pm
- Location: Decatur, GA
- Contact:
Thanks for finding the leak and even more for determining how to fix it! I've followed your advice and made + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys return an autoreleased dictionary instead of a retained one as it was doing; this fix will be in the next release of Growl.
What revision was this committed in? I don't see it in the history at a cursory glance.evands wrote:Thanks for finding the leak and even more for determining how to fix it! I've followed your advice and made + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys return an autoreleased dictionary instead of a retained one as it was doing; this fix will be in the next release of Growl.
Try my software!
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
#define ADIUMX pimp //by me
#define QUESTION ((2b) || (!2b))
Have you hugged a programmer today?
- evands
- Cocoaforge Admin
- Posts: 3152
- Joined: Thu Dec 02, 2004 10:55 pm
- Location: Decatur, GA
- Contact:
Oops. I told it to commit, but apparently it failed and I didn't notice; I had a tmp file with the message.bgannin wrote:What revision was this committed in? I don't see it in the history at a cursory glance.evands wrote:Thanks for finding the leak and even more for determining how to fix it! I've followed your advice and made + (NSDictionary *) registrationDictionaryByFillingInDictionary:(NSDictionary *)regDict restrictToKeys:(NSSet *)keys return an autoreleased dictionary instead of a retained one as it was doing; this fix will be in the next release of Growl.
[4691]