Mailing Lists: Apple Mailing Lists

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

RemoveEventFromQueue()



Hi,

I want to keep certain events in the queue and remove them later.
Is it okay to do the following:

if(ReceiveNextEvent(0, NULL, kEventDurationNoWait, FALSE, &theEvent) == noErr)
{
 if(GetEventClass(theEvent) != <event to skip>) {
  SendEventToEventTarget(theEvent, theTarget);
  RemoveEventFromQueue(GetMainEventQueue(), theEvent);
 }
}

I'm especially worried about the RemoveEventFromQueue(): Does it release the
event? I'm asking because originally I had a ReleaseEvent() after REFQ(), but
that crashed. So I suppose REFQ() releases the event too if its ref count is 0.

Is the code above allright?

Tks

Andreas



 _______________________________________________
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



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.