Fixed eventlistener memory leak in castv2/lib/channel#56
Open
BasKiers wants to merge 1 commit intothibauts:masterfrom
Open
Fixed eventlistener memory leak in castv2/lib/channel#56BasKiers wants to merge 1 commit intothibauts:masterfrom
BasKiers wants to merge 1 commit intothibauts:masterfrom
Conversation
Added onCloseListener to DefaultMediaReceiver Handled close event to propagate to MediaController in DefaultMediaReceiver
|
Note in case a maintainer comes along: if this was ever valid, its not anymore as MediaController doesn't even emit a disconnect event. Further, with the current castv2 implementation and castv2-client callstack, I think you want this relationship flipped: Just like Application.close handles the disposal of the connection Controller, DefaultMediaReceiver should expose a "close" override that cleans up the MediaController references and then chain calls Application.close (a pattern seen elsewhere here). Also samples should be updated to make clear that receivers should have "close" called on them when disposing to prevent this memory leak after that's implemented. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When creating multiple DefaultMediaReceivers the listeners from the previous MediaReceivers would not be cleaned up properly causing the following message:
I've added an onDisconnectListener and onCloseListener to DefaultMediaReceiver to propegate the close event to the MediaController so all old listeners will be removed.