Skip to content

Commit

Permalink
fixed removeEventListener on wrong objects
Browse files Browse the repository at this point in the history
  • Loading branch information
MatseFR committed Mar 2, 2023
1 parent b29d9bc commit fbdfce4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
5 changes: 3 additions & 2 deletions source/feathers/controls/Button.as
Original file line number Diff line number Diff line change
Expand Up @@ -1957,9 +1957,10 @@ package feathers.controls
{
processStyleRestriction(key);
}
if(format !== null)
var oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state);
if(oldFormat !== null)
{
format.removeEventListener(Event.CHANGE, changeHandler);
oldFormat.removeEventListener(Event.CHANGE, changeHandler);
}
this._fontStylesSet.setFormatForState(state, format);
if(format !== null)
Expand Down
5 changes: 3 additions & 2 deletions source/feathers/controls/TextArea.as
Original file line number Diff line number Diff line change
Expand Up @@ -1695,9 +1695,10 @@ package feathers.controls
{
processStyleRestriction(key);
}
if(format !== null)
var oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state);
if(oldFormat !== null)
{
format.removeEventListener(Event.CHANGE, changeHandler);
oldFormat.removeEventListener(Event.CHANGE, changeHandler);
}
this._fontStylesSet.setFormatForState(state, format);
if(format !== null)
Expand Down
10 changes: 6 additions & 4 deletions source/feathers/controls/TextInput.as
Original file line number Diff line number Diff line change
Expand Up @@ -2597,9 +2597,10 @@ package feathers.controls
{
processStyleRestriction(key);
}
if(format !== null)
var oldFormat:TextFormat = this._fontStylesSet.getFormatForState(state);
if(oldFormat !== null)
{
format.removeEventListener(Event.CHANGE, changeHandler);
oldFormat.removeEventListener(Event.CHANGE, changeHandler);
}
this._fontStylesSet.setFormatForState(state, format);
if(format !== null)
Expand Down Expand Up @@ -2656,9 +2657,10 @@ package feathers.controls
{
processStyleRestriction(key);
}
if(format !== null)
var oldFormat:TextFormat = this._promptFontStylesSet.getFormatForState(state);
if(oldFormat !== null)
{
format.removeEventListener(Event.CHANGE, changeHandler);
oldFormat.removeEventListener(Event.CHANGE, changeHandler);
}
this._promptFontStylesSet.setFormatForState(state, format);
if(format !== null)
Expand Down
10 changes: 6 additions & 4 deletions source/feathers/controls/ToggleSwitch.as
Original file line number Diff line number Diff line change
Expand Up @@ -2469,9 +2469,10 @@ package feathers.controls
{
processStyleRestriction(key);
}
if(format !== null)
var oldValue:TextFormat = this._onLabelFontStylesSet.getFormatForState(state);
if (oldValue !== null)
{
format.removeEventListener(Event.CHANGE, changeHandler);
oldValue.removeEventListener(Event.CHANGE, changeHandler);
}
this._onLabelFontStylesSet.setFormatForState(state, format);
if(format !== null)
Expand Down Expand Up @@ -2528,9 +2529,10 @@ package feathers.controls
{
processStyleRestriction(key);
}
if(format !== null)
var oldValue:TextFormat = this._offLabelFontStylesSet.getFormatForState(state);
if(oldValue !== null)
{
format.removeEventListener(Event.CHANGE, changeHandler);
oldValue.removeEventListener(Event.CHANGE, changeHandler);
}
this._offLabelFontStylesSet.setFormatForState(state, format);
if(format !== null)
Expand Down

0 comments on commit fbdfce4

Please sign in to comment.