Bug 1279984 - allow destroying proxies without a wrapper r=davidb, a=al
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Tue, 21 Jun 2016 09:46:24 -0400
changeset 342016 849d3bd0de05dade0a4e6cf1528ee7a63e85616d
parent 342015 e6d4eb4ec4645e2e432ce0e03e511071e0ec037b
child 342017 84020ba5861cdb30d7af23a3482324b92b77451a
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb, al
bugs1279984
milestone49.0a2
Bug 1279984 - allow destroying proxies without a wrapper r=davidb, a=al We can sometimes call ProxyDestroyed() on a proxy that never had a wrapper set up so we should just bail out of ProxyDestroyed() in that case because there is nothing to do.
accessible/atk/AccessibleWrap.cpp
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -1152,16 +1152,20 @@ a11y::ProxyCreated(ProxyAccessible* aPro
   obj->layer = ATK_LAYER_INVALID;
   aProxy->SetWrapper(reinterpret_cast<uintptr_t>(obj) | IS_PROXY);
 }
 
 void
 a11y::ProxyDestroyed(ProxyAccessible* aProxy)
 {
   auto obj = reinterpret_cast<MaiAtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
+  if (!obj) {
+    return;
+  }
+
   obj->Shutdown();
   g_object_unref(obj);
   aProxy->SetWrapper(0);
 }
 
 nsresult
 AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
 {