bug 1351475 - allow the windows ProxyDestroyed() function to called with a proxy with no wrapper.
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 28 Mar 2017 16:09:27 -0400
changeset 553329 7700cdd26f31fe55ab42359fdec3df310f2ac626
parent 553328 569228700aaf92df3b2505878066e6919e422e8f
child 553330 893df0dc9b9dd9111808a229423906d9d7a0df7a
push id51596
push usermozilla@kaply.com
push dateWed, 29 Mar 2017 20:39:42 +0000
bugs1351475
milestone55.0a1
bug 1351475 - allow the windows ProxyDestroyed() function to called with a proxy with no wrapper. unfortunately because creating a DocAccessibleParent is not atomic one can be created by AllocPDocAccessible(), but then RecvPDocAccessibleConstructor() can fail. If that happens we will call actor destroyed on the new DocAccessibleParent, however because the constructor messaged failed it will not have a wrapper. That means this assert does not necessarily hold.
accessible/windows/msaa/Platform.cpp
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -81,17 +81,20 @@ a11y::ProxyCreated(ProxyAccessible* aPro
   aProxy->SetWrapper(reinterpret_cast<uintptr_t>(wrapper));
 }
 
 void
 a11y::ProxyDestroyed(ProxyAccessible* aProxy)
 {
   AccessibleWrap* wrapper =
     reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
-  MOZ_ASSERT(wrapper);
+
+  // If aProxy is a document that was created, but
+  // RecvPDocAccessibleConstructor failed then aProxy->GetWrapper() will be
+  // null.
   if (!wrapper)
     return;
 
   if (aProxy->IsDoc() && nsWinUtils::IsWindowEmulationStarted()) {
     aProxy->AsDoc()->SetEmulatedWindowHandle(nullptr);
   }
 
   wrapper->Shutdown();