How to register and unregister gracefully in Growl?

The Growl forums have moved to Google Groups, this forum is read only.
Locked
stapoz
Harmless
Posts: 2
Joined: Tue May 08, 2007 1:31 pm

How to register and unregister gracefully in Growl?

Post by stapoz »

When I make [GrowlApplicationBridge setGrowlDelegate:self], Growl framework retains my object (self) so my dealloc method is never called.

If I try [GrowlApplicationBridge setGrowlDelegate:nil] in ApplicationWillTerminate method, Growl releases my object and now dealloc is called.
But as a side effect Growl displays warning "The Growl delegate did not supply a registration dictionary".

Do you know how should I unregister my object in Growl when application is finished?
mipadi
Frappa
Posts: 175
Joined: Thu Dec 09, 2004 4:29 pm
Location: New York, USA
Contact:

Post by mipadi »

It shouldn't really matter if it is retained. The memory associated with your application should get released by the operating system when your application exits, and you want the delegate to be retained until the application exits anyway.
stapoz
Harmless
Posts: 2
Joined: Tue May 08, 2007 1:31 pm

Post by stapoz »

Yes. but dealloc is called when retainCount is equal to zero which never happens because Growl keeps one handle. My dealloc contains some important functions which are never called and the application is terminated without proper functions calling.
Locked