author | JW Wang <jwwang@mozilla.com> |
Wed, 20 Sep 2017 17:51:10 +0800 | |
changeset 381917 | f9e527aa4ba5d497880de2a677c51b8ee6e27e63 |
parent 381916 | 0848279b2b72c10e8ae6b3cfcdff2e97355dc593 |
child 381918 | ff6c67a5c98680051727e4e9aac42fd28ca59119 |
push id | 32542 |
push user | kwierso@gmail.com |
push date | Wed, 20 Sep 2017 21:07:55 +0000 |
treeherder | mozilla-central@319a34bea9e4 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kaku |
bugs | 1401366 |
milestone | 57.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/dom/html/HTMLMediaElement.cpp +++ b/dom/html/HTMLMediaElement.cpp @@ -3768,17 +3768,21 @@ class HTMLMediaElement::ShutdownObserver Unsubscribed }; public: NS_DECL_ISUPPORTS 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(); } return NS_OK; } void Subscribe(HTMLMediaElement* aPtr) {