On Nov 22, 2010, at 5:14 PM, George Nachman wrote:

> I recently added an event tap to my program. Since doing that, there is a
> strange behavior: when I kill my job (usually by making a change in Xcode
> and pressing cmd-Enter, being prompted to kill the job, and selecting OK),
> it will repeat back the last 10-20 keypresses as or after it dies


You have to uninstall an event tap when you're through with it. Perhaps you 
aren't uninstalling it, and it lives on?

Apple engineer Mike Paquette explained how to do this in messages to the 
quartz-dev mailing list on 2007-03-18 and 2008-02-12:

CFMachPortInvalidate(tapMachPortRef); // switches off the event tap; 
invalidates tapRunLoopSourceRef, too, and drops retain counts on both by 1 so 
the CFRelease will release the objects and not leak
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), tapRunLoopSourceRef, 
kCFRunLoopCommonModes);
CFRelease(tapRunLoopSourceRef);
CFRelease(tapMachPortRef);

--

Bill Cheeseman - b...@cheeseman.name

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to