Bug 611457 - Move the object which is supposed to survive the function's return out of the function so that a possible garbage collection doesn't collect it before it should be used; r=roc a=test-only

This commit is contained in:
Ehsan Akhgari 2011-03-12 00:07:37 -05:00
Родитель bdcb5e4f05
Коммит 4f5080cfa0
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -100,14 +100,14 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607584
mEditor: null
};
var progress;
var progress, progressListener;
function runTest() {
var newEditorElement = document.getElementById("editor");
newEditorElement.makeEditable("html", true);
var docShell = newEditorElement.boxObject.QueryInterface(Components.interfaces.nsIEditorBoxObject).docShell;
progress = docShell.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebProgress);
var progressListener = new EditorContentListener(newEditorElement);
progressListener = new EditorContentListener(newEditorElement);
progress.addProgressListener(progressListener, Components.interfaces.nsIWebProgress.NOTIFY_ALL);
newEditorElement.setAttribute("src", "data:text/html,");
}