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; }