googlecast/CastCompanionLibrary-android — pull request #126 by a-ch (2014-11-06 08:47:55+00:00)
Title: Preventing Activity leak if it was passed as Context argument

As far as I remember passing application Context to initialize CastManager will eventually lead to an exception in some cases (sorry, cannot check it now) and will prevent dialogs from using application theme, so Activity is likely to be provided as an argument to initialize CastManager. If so, then Activity will leak since BaseCastManager.setContext(..) doesn't reset Context for MediaRouter, CastMediaRouterCallback and AudioManager.