Skip to content

Commit

Permalink
fix: issue of registered listener is not being remove on RemoveListener.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Sep 30, 2024
1 parent f352181 commit 28b8125
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Api/PubnubApi/Pubnub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -412,15 +412,18 @@ public bool AddListener(SubscribeCallback listener)
}
}

public bool RemoveListener(SubscribeCallback listener)
{
bool ret = false;
if (subscribeCallbackListenerList != null)
{
ret = subscribeCallbackListenerList.Remove(listener);
}
return ret;
}
public bool RemoveListener(SubscribeCallback listener)
{
bool ret = false;
if (subscribeCallbackListenerList != null) {
ret = subscribeCallbackListenerList.Remove(listener);
}
if (listenerManager != null) {
var removeFromListenerManager = listenerManager.RemoveListener(listener);
if (!ret) ret = ret || removeFromListenerManager;
}
return ret;
}
#endregion

public EndPoint.SendFileOperation SendFile()
Expand Down

0 comments on commit 28b8125

Please sign in to comment.