Open BasKiers opened 7 years ago
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.
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.