Leak fix for bug 539843. Make sure that .cleanup() is called in all the error conditions so that the pending-submit list is cleaned up. r=Mossop

This commit is contained in:
Benjamin Smedberg 2010-02-10 12:20:37 -05:00
Родитель 7546a30a33
Коммит e9c74dd112
2 изменённых файлов: 8 добавлений и 4 удалений

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

@ -1410,6 +1410,7 @@ function BrowserShutdown()
.getService(Components.interfaces.nsIObserverService);
os.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
os.removeObserver(gXPInstallObserver, "xpinstall-install-blocked");
os.removeObserver(gMissingPluginInstaller.pluginCrashed, "plugin-crashed");
try {
gBrowser.removeProgressListener(window.XULBrowserWindow);

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

@ -273,8 +273,8 @@ Submitter.prototype = {
this.element.removeChild(this.iframe);
if (this.errorCallback) {
this.errorCallback(this.id);
this.cleanup();
}
this.cleanup();
return 0;
}
// check HTTP status
@ -283,8 +283,8 @@ Submitter.prototype = {
this.element.removeChild(this.iframe);
if (this.errorCallback) {
this.errorCallback(this.id);
this.cleanup();
}
this.cleanup();
return 0;
}
@ -303,8 +303,10 @@ Submitter.prototype = {
submit: function Submitter_submit()
{
let [dump, extra] = getPendingMinidump(this.id);
if (!dump.exists() || !extra.exists())
if (!dump.exists() || !extra.exists()) {
this.cleanup();
return false;
}
this.dump = dump;
this.extra = extra;
let iframe = this.document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul", "iframe");
@ -315,7 +317,8 @@ Submitter.prototype = {
if (iframe.contentWindow.location == "about:blank")
return;
iframe.removeEventListener("load", loadHandler, true);
self.submitForm();
if (!self.submitForm())
self.cleanup();
}
iframe.addEventListener("load", loadHandler, true);