Skip to content

Commit

Permalink
Bug 1401366. P2 - bail out Observe() if not subcribed per comment 2. …
Browse files Browse the repository at this point in the history
…r=kaku

MozReview-Commit-ID: 4LEBD3g0OwX

--HG--
extra : rebase_source : c31cb94eeb52b06a3f327492b918e93c82b83616
  • Loading branch information
jwwang committed Sep 20, 2017
1 parent ed0a449 commit 16f3e9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3773,7 +3773,11 @@ class HTMLMediaElement::ShutdownObserver : public nsIObserver

NS_IMETHOD Observe(nsISupports*, const char* aTopic, const char16_t*) override
{
MOZ_DIAGNOSTIC_ASSERT(mPhase == Phase::Subscribed);
if (mPhase != Phase::Subscribed) {
// Bail out if we are not subscribed for this might be called even after
// |nsContentUtils::UnregisterShutdownObserver(this)|.
return NS_OK;
}
MOZ_DIAGNOSTIC_ASSERT(mWeak);
if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
mWeak->NotifyShutdownEvent();
Expand Down

0 comments on commit 16f3e9d

Please sign in to comment.