Bug 741053 - crash in nsIDocument::GetRootElement, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 03 Apr 2012 01:25:15 +0900
changeset 90845 8701e9dd771551dcb07701aa9624e543a8050e3d
parent 90844 3a185f0347686cd87719967c75c2078d50e836bf
child 90846 57e51e0c0c7800c8b698b2fea2c8bccffcf30c0e
push idunknown
push userunknown
push dateunknown
reviewerstbsaunde
bugs741053
milestone14.0a1
Bug 741053 - crash in nsIDocument::GetRootElement, r=tbsaunde
accessible/src/atk/nsRootAccessibleWrap.cpp
--- a/accessible/src/atk/nsRootAccessibleWrap.cpp
+++ b/accessible/src/atk/nsRootAccessibleWrap.cpp
@@ -39,17 +39,21 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsMai.h"
 #include "nsRootAccessibleWrap.h"
 
 nsNativeRootAccessibleWrap::nsNativeRootAccessibleWrap(AtkObject *aAccessible):
     nsRootAccessible(nsnull, nsnull, nsnull)
 {
-    g_object_ref(aAccessible);
-    mAtkObject = aAccessible;
+  // XXX: mark the object as defunct to ensure no single internal method is
+  // running on it.
+  mFlags |= eIsDefunct;
+
+  g_object_ref(aAccessible);
+  mAtkObject = aAccessible;
 }
 
 nsNativeRootAccessibleWrap::~nsNativeRootAccessibleWrap()
 {
     g_object_unref(mAtkObject);
     mAtkObject = nsnull;
 }