| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Tuesday, August 26, 2003, at 05:22 PM, Bob Sabiston wrote:Do the calls to NewEventHandlerUPP() reserve memory that I should be freeing? When should I free it? If the function that installs the handlers gets called many times, do I have a memory leak?
Yes you probably have a leak.
You only need one UPP for any callback. I use a static variable and do this:
{
static EventHandlerUPP handlerUPP = NewEventHandlerUPP(MyHandler);
verify_noerr(InstallApplicationEventHandler(handlerUPP, GetEventTypeCount(events), events, (void *) this, NULL));
}
| References: | |
| >Re: Event Handler UPP question (From: Bryan Pietrzak <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.