Fix for bug 430624 (Crash [@ nsDocShellEditorData::DetachFromWindow] with spellcheck attribute). Patch by cpearce, r=peterv, sr=jst.

git-svn-id: svn://10.0.0.236/trunk@251098 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
peterv%propagandism.org
2008-05-02 11:36:31 +00:00
parent f1b88a235a
commit 12abbe164f
11 changed files with 124 additions and 72 deletions

View File

@@ -73,12 +73,12 @@ nsDocShellEditorData::~nsDocShellEditorData()
void
nsDocShellEditorData::TearDownEditor()
{
NS_ASSERTION(mIsDetached, "We should be detached before tearing down");
if (mEditor) {
mEditor->PreDestroy();
mEditor = nsnull;
}
mEditingSession = nsnull;
mIsDetached = PR_FALSE;
}
@@ -244,12 +244,16 @@ nsDocShellEditorData::DetachFromWindow()
if (htmlDoc)
mDetachedEditingState = htmlDoc->GetEditingState();
mDocShell = nsnull;
return NS_OK;
}
nsresult
nsDocShellEditorData::ReattachToWindow(nsIDOMWindow *aWindow)
nsDocShellEditorData::ReattachToWindow(nsIDocShell* aDocShell)
{
mDocShell = aDocShell;
nsCOMPtr<nsIDOMWindow> domWindow = do_GetInterface(mDocShell);
nsresult rv = mEditingSession->ReattachToWindow(domWindow);
NS_ENSURE_SUCCESS(rv, rv);