Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Closing windows with event handlers attached



On Mar 1, 2005, at 10:12 PM, Bryan Pietrzak wrote:

On Mar 1, 2005, at 8:13 PM, Andrew Gillanders wrote:

I have a normal document window (standard event handler installed) which has an event handler attached to it. When I close the window, are the event handlers automatically discarded, or do I have to explicitly remove them before closing the window?

Yes, when a target goes away, any handler installed on it is removed.

I am under the impression that if you install the handler using NewEventHandlerUPP(), you will need to call DisposeEventHandlerUPP() manually.


But there's also the common practice to have a static variable to allocate NewEventHandlerUPP() once, use it everywhere, and don't call DisposeEventHandlerUPP() and let your process ends with it.

So depends on what you are doing...

pete


_______________________________________________ Do not post admin requests to the list. They will be ignored. Carbon-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Closing windows with event handlers attached (From: Andrew Gillanders <email@hidden>)
 >Re: Closing windows with event handlers attached (From: Bryan Pietrzak <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.