diff --git a/editor/base/nsEditorShell.cpp b/editor/base/nsEditorShell.cpp index a0a5bd7b997..f8ef32ec910 100644 --- a/editor/base/nsEditorShell.cpp +++ b/editor/base/nsEditorShell.cpp @@ -349,6 +349,12 @@ nsEditorShell::ResetEditingState() // one URL into the content area. Let's tear down what we have, and rip 'em a // new one. + nsCOMPtr editor(do_QueryInterface(mEditor)); + if (editor) + { + editor->PreDestroy(); + } + // Unload existing stylesheets nsCOMPtr styleSheets = do_QueryInterface(mEditor); if (styleSheets) diff --git a/editor/composer/src/nsEditorShell.cpp b/editor/composer/src/nsEditorShell.cpp index a0a5bd7b997..f8ef32ec910 100644 --- a/editor/composer/src/nsEditorShell.cpp +++ b/editor/composer/src/nsEditorShell.cpp @@ -349,6 +349,12 @@ nsEditorShell::ResetEditingState() // one URL into the content area. Let's tear down what we have, and rip 'em a // new one. + nsCOMPtr editor(do_QueryInterface(mEditor)); + if (editor) + { + editor->PreDestroy(); + } + // Unload existing stylesheets nsCOMPtr styleSheets = do_QueryInterface(mEditor); if (styleSheets)