I can't get the player to be properly destroyed, and I think I have found a reference cycle in ShakaPlayerView which prevents it to be destroyed (causing the rest of the object graph to be kept in memory).
According to the documentation regarding the target parameter of scheduledTimerWithTimeInterval:target:selector:userInfo:repeats: (bold highlight is mine):
The object to which to send the message specified by aSelector when the timer fires. The timer maintains a strong reference to target until it (the timer) is invalidated.
I haven't been able to find any place in the code where these timers are invalidated or destroyed (setting the reference to nil), so it seems there's a reference cycle preventing the ShakaPlayerView (and in turn, the associated ShakaPlayer) to be destroyed.
I can't get the player to be properly destroyed, and I think I have found a reference cycle in
ShakaPlayerView
which prevents it to be destroyed (causing the rest of the object graph to be kept in memory).ShakaPlayerView
uses two timers:which are initialized in the
initWithPlayer:
initializer:According to the documentation regarding the
target
parameter ofscheduledTimerWithTimeInterval:target:selector:userInfo:repeats:
(bold highlight is mine):I haven't been able to find any place in the code where these timers are invalidated or destroyed (setting the reference to nil), so it seems there's a reference cycle preventing the
ShakaPlayerView
(and in turn, the associatedShakaPlayer
) to be destroyed.Am I right?