mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-04-12 03:57:27 +00:00
fix(essentials): Allows SubpageReferenceListSourceItem to deregister from room's CurrentSourceInfoChange event on Clear()
This commit is contained in:
parent
115a20d8e6
commit
5c02d72ed1
1 changed files with 6 additions and 0 deletions
|
|
@ -14,6 +14,8 @@ namespace PepperDash.Essentials
|
|||
{
|
||||
public SourceListItem SourceItem { get; private set; }
|
||||
|
||||
private IHasCurrentSourceInfoChange _room;
|
||||
|
||||
public SubpageReferenceListSourceItem(uint index, SubpageReferenceList owner,
|
||||
SourceListItem sourceItem, Action<bool> routeAction)
|
||||
: base(index, owner)
|
||||
|
|
@ -25,6 +27,7 @@ namespace PepperDash.Essentials
|
|||
|
||||
public void RegisterForSourceChange(IHasCurrentSourceInfoChange room)
|
||||
{
|
||||
_room = room;
|
||||
room.CurrentSourceChange -= room_CurrentSourceInfoChange;
|
||||
room.CurrentSourceChange += room_CurrentSourceInfoChange;
|
||||
}
|
||||
|
|
@ -44,6 +47,9 @@ namespace PepperDash.Essentials
|
|||
{
|
||||
Owner.BoolInputSig(Index, 1).UserObject = null;
|
||||
Owner.StringInputSig(Index, 1).StringValue = "";
|
||||
|
||||
if(_room != null)
|
||||
_room.CurrentSourceChange -= room_CurrentSourceInfoChange;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue