зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1365825: Fix occasional crashes on OSX when handling custom shortcuts. r=mstange
This commit is contained in:
Родитель
b63c15138b
Коммит
ce1514ce6c
|
@ -1284,9 +1284,7 @@ nsChildView::PostHandleKeyEvent(mozilla::WidgetKeyboardEvent* aEvent)
|
|||
// not handled we give menu items a chance to act. This allows for handling of
|
||||
// custom shortcuts. Note that existing shortcuts cannot be reassigned yet and
|
||||
// will have been handled by keyDown: before we get here.
|
||||
NSEvent* cocoaEvent =
|
||||
[sNativeKeyEventsMap objectForKey:@(aEvent->mUniqueId)];
|
||||
[sNativeKeyEventsMap removeObjectForKey:@(aEvent->mUniqueId)];
|
||||
NSEvent* cocoaEvent = [sNativeKeyEventsMap objectForKey:@(aEvent->mUniqueId)];
|
||||
if (!cocoaEvent) {
|
||||
return;
|
||||
}
|
||||
|
@ -1294,6 +1292,7 @@ nsChildView::PostHandleKeyEvent(mozilla::WidgetKeyboardEvent* aEvent)
|
|||
if (SendEventToNativeMenuSystem(cocoaEvent)) {
|
||||
aEvent->PreventDefault();
|
||||
}
|
||||
[sNativeKeyEventsMap removeObjectForKey:@(aEvent->mUniqueId)];
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче