mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
fix for bug 156940 - stop crashing on exit by manually releasing the 'param' attribute when the autocomplete widget goes away - this way the mork row doesn't hang around after the db is closed...
r=timeless, sr=sfraser
This commit is contained in:
parent
649813f42d
commit
d8e0d1d0a2
@ -55,6 +55,7 @@
|
||||
]]></constructor>
|
||||
|
||||
<destructor><![CDATA[
|
||||
this.clearResults(false);
|
||||
]]></destructor>
|
||||
|
||||
<!-- =================== PUBLIC PROPERTIES =================== -->
|
||||
@ -313,7 +314,7 @@
|
||||
<body><![CDATA[
|
||||
var obj = this.convertIndexToSession(aIndex);
|
||||
if (obj && this.mLastResults[obj.session]) {
|
||||
var nsIAutoCompleteItem = Components.interfaces.nsIAutoCompleteItem;
|
||||
const nsIAutoCompleteItem = Components.interfaces.nsIAutoCompleteItem;
|
||||
if (obj.index >= 0) {
|
||||
var item = this.mLastResults[obj.session].items.QueryElementAt(obj.index, nsIAutoCompleteItem);
|
||||
return item;
|
||||
@ -1065,8 +1066,19 @@
|
||||
<!-- -->
|
||||
<method name="clearResultData">
|
||||
<body><![CDATA[
|
||||
const nsIAutoCompleteItem =
|
||||
Components.interfaces.nsIAutoCompleteItem;
|
||||
for (var name in this.mSessions) {
|
||||
this.mLastResults[name] = null;
|
||||
// clearing out mLastResults[name] does not guarantee that
|
||||
// each result will go away right now (it might be gc'ed later)
|
||||
// so we have to clear the 'param' element manually
|
||||
var session = this.mLastResults[name];
|
||||
if (session) {
|
||||
const resultCount = session.items.Count();
|
||||
for (var i=0; i<resultCount; i++)
|
||||
session.items.QueryElementAt(i, nsIAutoCompleteItem).param = null;
|
||||
this.mLastResults[name] = null;
|
||||
}
|
||||
this.mLastStatus[name] = null;
|
||||
}
|
||||
]]></body>
|
||||
|
Loading…
Reference in New Issue
Block a user