mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 383271: break the cycle between the search suggest component and its timer (fixes leak when using search suggestions), r=mconnor
This commit is contained in:
parent
08c3558b5b
commit
3697f7098f
@ -332,17 +332,21 @@ SuggestAutoComplete.prototype = {
|
||||
_sentSuggestRequest: false,
|
||||
|
||||
/**
|
||||
* This is the callback for the suggest timeout timer. If this gets
|
||||
* called, it means that we've given up on receiving a reply from the
|
||||
* search engine's suggestion server in a timely manner.
|
||||
* This is the callback for the suggest timeout timer.
|
||||
*/
|
||||
notify: function SAC_notify(timer) {
|
||||
// make sure we're still waiting for this response before sending
|
||||
if ((timer != this._formHistoryTimer) || !this._listener)
|
||||
// FIXME: bug 387341
|
||||
// Need to break the cycle between us and the timer.
|
||||
this._formHistoryTimer = null;
|
||||
|
||||
// If this._listener is null, we've already sent out suggest results, so
|
||||
// nothing left to do here.
|
||||
if (!this._listener)
|
||||
return;
|
||||
|
||||
// Otherwise, the XMLHTTPRequest for suggest results is taking too long,
|
||||
// so send out the form history results and cancel the request.
|
||||
this._listener.onSearchResult(this, this._formHistoryResult);
|
||||
this._formHistoryTimer = null;
|
||||
this._reset();
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user