Crash while doing Flash IME. b=443024 r=josh,masayuki sr=vladimir

This commit is contained in:
Steven Michaud 2008-07-14 09:38:49 -05:00
Родитель 18042af9cc
Коммит dc085b2e37
2 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -195,6 +195,8 @@ public:
static PRBool IsIMEEnabled() { return sIsIMEEnabled; }
static PRBool IgnoreCommit() { return sIgnoreCommit; }
static void OnDestroyView(NSView<mozView>* aDestroyingView);
// Note that we cannot get the actual state in TSM. But we can trust this
// value. Because nsIMEStateManager reset this at every focus changing.
static PRBool IsRomanKeyboardsOnly() { return sIsRomanKeyboardsOnly; }

Просмотреть файл

@ -2271,6 +2271,7 @@ NSEvent* gLastDragEvent = nil;
- (void)widgetDestroyed
{
nsTSMManager::OnDestroyView(self);
mGeckoChild = nsnull;
// Just in case we're destroyed abruptly and missed the draggingExited
// or performDragOperation message.
@ -6006,6 +6007,18 @@ static BOOL keyUpAlreadySentKeyDown = NO;
#pragma mark -
void
nsTSMManager::OnDestroyView(NSView<mozView>* aDestroyingView)
{
if (aDestroyingView != sComposingView)
return;
if (IsComposing()) {
CancelIME(); // XXX Might CancelIME() fail because sComposingView is being destroyed?
EndComposing();
}
}
PRBool
nsTSMManager::GetIMEOpenState()
{