Fix for crashes in EventStateManager that may people are seeing. Bug 27727. r=hyatt

git-svn-id: svn://10.0.0.236/trunk@60753 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
saari%netscape.com 2000-02-15 00:28:43 +00:00
parent 2843476366
commit 620f8e6169
2 changed files with 14 additions and 4 deletions

View File

@ -552,8 +552,13 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
if (gLastFocusedContent) {
nsCOMPtr<nsIDocument> doc;
gLastFocusedContent->GetDocument(*getter_AddRefs(doc));
doc->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
}
if(doc)
doc->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
else {
mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
NS_RELEASE(gLastFocusedContent);
}
}
else mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
// Suppress the command dispatcher for the duration of the

View File

@ -552,8 +552,13 @@ nsEventStateManager::PreHandleEvent(nsIPresContext* aPresContext,
if (gLastFocusedContent) {
nsCOMPtr<nsIDocument> doc;
gLastFocusedContent->GetDocument(*getter_AddRefs(doc));
doc->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
}
if(doc)
doc->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
else {
mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
NS_RELEASE(gLastFocusedContent);
}
}
else mDocument->GetScriptGlobalObject(getter_AddRefs(ourGlobal));
// Suppress the command dispatcher for the duration of the