Workaround for the bustage caused by bug 472253.

This commit is contained in:
Dave Camp 2009-01-05 20:12:30 -08:00
Родитель 533f2299ff
Коммит 1dbc5c92fa
3 изменённых файлов: 20 добавлений и 3 удалений

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

@ -77,7 +77,7 @@ function PROT_ListManager() {
this.tablesData = {};
this.observerServiceObserver_ = new G_ObserverServiceObserver(
'xpcom-shutdown',
'quit-application',
BindToObject(this.shutdown_, this),
true /*only once*/);
@ -119,6 +119,10 @@ function PROT_ListManager() {
* Delete all of our data tables which seem to leak otherwise.
*/
PROT_ListManager.prototype.shutdown_ = function() {
if (this.keyManager_) {
this.keyManager_.shutdown();
}
for (var name in this.tablesData) {
delete this.tablesData[name];
}

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

@ -212,8 +212,8 @@ PROT_UrlCryptoKeyManager.prototype.reKey = function() {
G_Debug(this, "Attempting to re-key");
// If the keyUrl isn't set, we don't do anything.
if (!this.testing_ && this.keyUrl_) {
(new PROT_XMLFetcher()).get(this.keyUrl_,
BindToObject(this.onGetKeyResponse, this));
this.fetcher_ = new PROT_XMLFetcher();
this.fetcher_.get(this.keyUrl_, BindToObject(this.onGetKeyResponse, this));
this.updating_ = true;
// Calculate the next time we're allowed to re-key.
@ -348,6 +348,7 @@ PROT_UrlCryptoKeyManager.prototype.onGetKeyResponse = function(responseText) {
var wrappedKey = response[this.WRAPPED_KEY_NAME];
this.updating_ = false;
this.fetcher_ = null;
if (response && clientKey && wrappedKey) {
G_Debug(this, "Got new key from: " + responseText);
@ -418,6 +419,13 @@ PROT_UrlCryptoKeyManager.prototype.maybeLoadOldKey = function() {
}
}
PROT_UrlCryptoKeyManager.prototype.shutdown = function() {
if (this.fetcher_) {
this.fetcher_.cancel();
this.fetcher_ = null;
}
}
#ifdef DEBUG
/**

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

@ -110,6 +110,11 @@ PROT_XMLFetcher.prototype = {
this._request.send(null);
},
cancel: function() {
this._request.onreadystatechange = null;
this._request.abort();
},
/**
* Called periodically by the request to indicate some state change. 4
* means content has been received.