From 6a9b130b93b12d20f2e34d916ec59142594f6d25 Mon Sep 17 00:00:00 2001 From: Steven Michaud Date: Wed, 7 Jan 2009 17:03:56 -0600 Subject: [PATCH] Delete event tap correctly. b=436897 r=josh sr=roc --- widget/src/cocoa/nsToolkit.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/widget/src/cocoa/nsToolkit.mm b/widget/src/cocoa/nsToolkit.mm index d6729060177..747872edb02 100644 --- a/widget/src/cocoa/nsToolkit.mm +++ b/widget/src/cocoa/nsToolkit.mm @@ -343,6 +343,10 @@ nsToolkit::UnregisterAllProcessMouseEventHandlers() mEventTapRLS = nsnull; } if (mEventTapPort) { + // mEventTapPort must be invalidated as well as released. Otherwise the + // event tap doesn't get destroyed until the browser process ends (it + // keeps showing up in the list returned by CGGetEventTapList()). + CFMachPortInvalidate(mEventTapPort); CFRelease(mEventTapPort); mEventTapPort = nsnull; }