Crash while doing Flash IME. b=443024 r=josh,masayuki sr=vlad a=ss

This commit is contained in:
smichaud%pobox.com 2008-07-22 15:19:11 +00:00
Родитель 2f1a42e2b9
Коммит fe90ff3f15
2 изменённых файлов: 15 добавлений и 0 удалений

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

@ -197,6 +197,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; }

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

@ -2226,6 +2226,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.
@ -5957,6 +5958,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()
{