Fix test bustage by reordering reference clearing. Unit tests attempt to start new searches from result callbacks.

This commit is contained in:
dtownsend@oxymoronical.com 2008-04-17 06:18:46 -07:00
parent 7f68925250
commit a7801a361b

View File

@ -181,19 +181,23 @@ AddonRepository.prototype = {
_reportSuccess: function(aCount) {
this._searching = false;
this._request = null;
this._callback.searchSucceeded(this._addons, this._addons.length,
this._recommended ? -1 : aCount);
// The callback may want to trigger a new search so clear references early
var addons = this._addons;
var callback = this._callback;
this._callback = null;
this._addons = null;
callback.searchSucceeded(addons, addons.length, this._recommended ? -1 : aCount);
},
// Notifies the callback of a failure
_reportFailure: function(aEvent) {
this._searching = false;
this._request = null;
this._callback.searchFailed();
// The callback may want to trigger a new search so clear references early
var callback = this._callback;
this._callback = null;
this._addons = null;
callback.searchFailed();
},
// Parses an add-on entry from an <addon> element