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:
alecf%netscape.com 2003-01-14 00:41:01 +00:00
parent 649813f42d
commit d8e0d1d0a2

View File

@ -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>