Bug 517768 - crash with view page source and external editor [@nsDocShell::OnStateChange(nsIWebProgress*, nsIRequest*, unsigned int, unsigned int) ]. r=bz

This commit is contained in:
Dão Gottwald 2009-10-02 20:33:55 +02:00
parent 628a6ad230
commit 705bcd826f

View File

@ -141,6 +141,7 @@ var gViewSourceUtils = {
// at all correctly; if somehow the view-source stuff managed to // at all correctly; if somehow the view-source stuff managed to
// execute script we'd be in big trouble here, I suspect. // execute script we'd be in big trouble here, I suspect.
var webShell = Components.classes["@mozilla.org/docshell;1"].createInstance(); var webShell = Components.classes["@mozilla.org/docshell;1"].createInstance();
webShell.QueryInterface(Components.interfaces.nsIBaseWindow).create();
this.viewSourceProgressListener.webShell = webShell; this.viewSourceProgressListener.webShell = webShell;
var progress = webShell.QueryInterface(this.mnsIWebProgress); var progress = webShell.QueryInterface(this.mnsIWebProgress);
progress.addProgressListener(this.viewSourceProgressListener, progress.addProgressListener(this.viewSourceProgressListener,
@ -214,6 +215,7 @@ var gViewSourceUtils = {
}, },
destroy: function() { destroy: function() {
this.webShell.QueryInterface(Components.interfaces.nsIBaseWindow).destroy();
this.webShell = null; this.webShell = null;
this.editor = null; this.editor = null;
this.callBack = null; this.callBack = null;