Fix bug 400556 by tearing down editor a little earlier. r+sr=peterv

This commit is contained in:
bzbarsky@mit.edu 2007-12-02 18:07:16 -08:00
parent 5953cabe8c
commit 8cd5fb6cd8
3 changed files with 16 additions and 1 deletions

View File

@ -1004,6 +1004,12 @@ nsDocShell::FirePageHideNotification(PRBool aIsUnload)
}
}
// Now make sure our editor, if any, is torn down before we go
// any farther.
if (mEditorData) {
mEditorData->TearDownEditor();
}
return NS_OK;
}

View File

@ -67,6 +67,12 @@ nsDocShellEditorData::nsDocShellEditorData(nsIDocShell* inOwningDocShell)
----------------------------------------------------------------------------*/
nsDocShellEditorData::~nsDocShellEditorData()
{
TearDownEditor();
}
void
nsDocShellEditorData::TearDownEditor()
{
if (mEditingSession)
{

View File

@ -66,7 +66,7 @@ public:
~nsDocShellEditorData();
// set a flag to say this frame should be editable when the next url loads
// set a flag to say this frame should be editable when the next url loads
nsresult MakeEditable(PRBool inWaitForUriLoad);
PRBool GetEditable();
@ -84,6 +84,9 @@ public:
// set the editor on this docShell
nsresult SetEditor(nsIEditor *inEditor);
// Tear down the editor on this docshell, if any.
void TearDownEditor();
protected:
nsresult EnsureEditingSession();