mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 22:38:41 +09:00
Clear weak pointers in VTT shutdown observers.
This commit is contained in:
parent
55632b85e9
commit
bb5e286644
2 changed files with 14 additions and 3 deletions
|
|
@ -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*
|
||||
|
|
|
|||
|
|
@ -170,11 +170,15 @@ private:
|
|||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
|
||||
nsContentUtils::UnregisterShutdownObserver(this);
|
||||
mManager->NotifyShutdown();
|
||||
if (mManager) {
|
||||
mManager->NotifyShutdown();
|
||||
}
|
||||
Unregister();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void Unregister();
|
||||
|
||||
private:
|
||||
~ShutdownObserverProxy() {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue