diff --git a/accessible/src/atk/nsAccessibleWrap.cpp b/accessible/src/atk/nsAccessibleWrap.cpp index 0703f67eeb1..eb3131ff15e 100644 --- a/accessible/src/atk/nsAccessibleWrap.cpp +++ b/accessible/src/atk/nsAccessibleWrap.cpp @@ -302,6 +302,7 @@ nsAccessibleWrap::nsAccessibleWrap(nsIDOMNode* aNode, nsAccessibleWrap::~nsAccessibleWrap() { + NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called"); #ifdef MAI_LOGGING ++mAccWrapDeleted; diff --git a/accessible/src/atk/nsRootAccessibleWrap.cpp b/accessible/src/atk/nsRootAccessibleWrap.cpp index 2cdac8f48f8..58dd382b9a2 100644 --- a/accessible/src/atk/nsRootAccessibleWrap.cpp +++ b/accessible/src/atk/nsRootAccessibleWrap.cpp @@ -46,5 +46,11 @@ nsNativeRootAccessibleWrap::nsNativeRootAccessibleWrap(AtkObject *aAccessible): nsRootAccessible(nsnull, nsnull) { g_object_ref(aAccessible); - nsAccessibleWrap::mAtkObject = aAccessible; + mAtkObject = aAccessible; +} + +nsNativeRootAccessibleWrap::~nsNativeRootAccessibleWrap() +{ + g_object_unref(mAtkObject); + mAtkObject = nsnull; } diff --git a/accessible/src/atk/nsRootAccessibleWrap.h b/accessible/src/atk/nsRootAccessibleWrap.h index d57a893f1d6..bd7a04ed0a7 100644 --- a/accessible/src/atk/nsRootAccessibleWrap.h +++ b/accessible/src/atk/nsRootAccessibleWrap.h @@ -55,6 +55,7 @@ class nsNativeRootAccessibleWrap: public nsRootAccessible { public: nsNativeRootAccessibleWrap(AtkObject *aAccessible); + ~nsNativeRootAccessibleWrap(); }; #endif /* __NS_ROOT_ACCESSIBLE_WRAP_H__ */