Bug 1380905 - Allow HTMLComboboxAccessible to be shut down twice. r=Jamie
authorEitan Isaacson <eitan@monotonous.org>
Wed, 22 May 2019 04:50:31 +0000
changeset 475213 9d7773bd3ae77a29908e365d5eece5890a334ab6
parent 475212 020c8c871c0d3b3920fe95935cfef06501976c0f
child 475214 be5b9ac813f5b515a1884fd2c5048e6b601da694
push id36057
push useraciure@mozilla.com
push dateThu, 23 May 2019 21:52:03 +0000
treeherdermozilla-central@d551d37b9ad0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie
bugs1380905
milestone69.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
Bug 1380905 - Allow HTMLComboboxAccessible to be shut down twice. r=Jamie Accessibles can be shut down twice. For example, their doc might shut them down in its own ShutDown, while a reference is still being held by a dispatched event. When the event goes away, or the cycle collector kicks in, the accessible may be finally released and shut down again via LastRelease. Differential Revision: https://phabricator.services.mozilla.com/D31815
accessible/html/HTMLSelectAccessible.cpp
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -299,17 +299,17 @@ bool HTMLComboboxAccessible::RemoveChild
   if (AccessibleWrap::RemoveChild(aChild)) {
     mListAccessible = nullptr;
     return true;
   }
   return false;
 }
 
 void HTMLComboboxAccessible::Shutdown() {
-  MOZ_ASSERT(mDoc->IsDefunct() || !mListAccessible);
+  MOZ_ASSERT(!mDoc || mDoc->IsDefunct() || !mListAccessible);
   if (mListAccessible) {
     mListAccessible->Shutdown();
     mListAccessible = nullptr;
   }
 
   AccessibleWrap::Shutdown();
 }