[not part of the build] notifiers and corresponding event handlers were not correctly removed when an editor window is closed; b=398989; r=laurent@xulfr.org

git-svn-id: svn://10.0.0.236/trunk@237401 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
daniel%glazman.org 2007-10-08 12:41:23 +00:00
parent 35004d2094
commit 279d8f3f61

View File

@ -106,14 +106,15 @@ var NotifierUtils = {
if (aKeyword in this.mKeywords)
{
var index = this.mKeywords[aKeyword].indexOf(aFn);
if (index != -1)
{
this.mKeywords[aKeyword].splice(index, 1);
this.mContexts[aKeyword].splice(index, 1);
}
else
this._error("no such callback for notifier id", aKeyword);
var callbacks = this.mKeywords[aKeyword];
for (var index = 0; index < callbacks.length; index++)
if (callbacks[index] == aFn)
{
this.mKeywords[aKeyword].splice(index, 1);
this.mContexts[aKeyword].splice(index, 1);
return;
}
this._error("no such callback for notifier id", aKeyword);
}
else
this._error("called with unrecognized notifier id", aKeyword);