Bug 1455737 - Remove the result object from DownloadHistory when removing the view r=Mardak

MozReview-Commit-ID: 5Qb5j30eqFO

--HG--
extra : rebase_source : 5a01b533acd7ceee70c23f063bdc889daf7f8311
This commit is contained in:
Ursula Sarracini 2018-04-20 16:57:07 -04:00
Родитель 9d368a4f43
Коммит a13a915a4b
1 изменённых файлов: 11 добавлений и 0 удалений

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

@ -454,6 +454,17 @@ this.DownloadHistoryList.prototype = {
}, },
_result: null, _result: null,
/**
* Remove the view that belongs to this list via DownloadList's removeView. In
* addition, delete the result object to ensure there are no memory leaks.
*/
removeView(aView) {
DownloadList.prototype.removeView.call(this, aView);
// Clean up any active results that might still be observing. See bug 1455737
this.result = null;
},
/** /**
* Index of the first slot that contains a session download. This is equal to * Index of the first slot that contains a session download. This is equal to
* the length of the list when there are no session downloads. * the length of the list when there are no session downloads.