If an established subscription is disposed by calling its dispose function (which is returned by subscribe method itself), which is pretty common scenario, a memory leak occurs in the Client. A listeners field keep track callbacks which will get called when Client.dispose() method is called, but it doesn't properly clean up the callback if the subscription is disposed individually. This leads to constantly growing Client.listeners array if the subscription is frequently created and disposed through application's lifecycle.
If an established subscription is disposed by calling its dispose function (which is returned by
subscribe
method itself), which is pretty common scenario, a memory leak occurs in theClient
. Alisteners
field keep track callbacks which will get called whenClient.dispose()
method is called, but it doesn't properly clean up the callback if the subscription is disposed individually. This leads to constantly growingClient.listeners
array if the subscription is frequently created and disposed through application's lifecycle.