Clear weak pointers in VTT shutdown observers.

This commit is contained in:
wolfbeast 2018-12-11 23:17:50 +01:00 committed by Roy Tam
commit bb5e286644
2 changed files with 14 additions and 3 deletions

View file

@ -29,6 +29,13 @@ namespace dom {
NS_IMPL_ISUPPORTS(TextTrackManager::ShutdownObserverProxy, nsIObserver);
void
TextTrackManager::ShutdownObserverProxy::Unregister()
{
nsContentUtils::UnregisterShutdownObserver(this);
mManager = nullptr;
}
CompareTextTracks::CompareTextTracks(HTMLMediaElement* aMediaElement)
{
mMediaElement = aMediaElement;
@ -137,7 +144,7 @@ TextTrackManager::TextTrackManager(HTMLMediaElement *aMediaElement)
TextTrackManager::~TextTrackManager()
{
WEBVTT_LOG("%p ~TextTrackManager",this);
nsContentUtils::UnregisterShutdownObserver(mShutdownProxy);
mShutdownProxy->Unregister();
}
TextTrackList*