Bug 413325 nsNativeRootAccessibleWrap doesn't release ref of AtkObject of dialogs r=aaronleventhal

This commit is contained in:
ginn.chen@sun.com 2008-01-21 21:29:40 -08:00
parent 2641f01d3d
commit 2d6ba3a46f
3 changed files with 9 additions and 1 deletions

View File

@ -302,6 +302,7 @@ nsAccessibleWrap::nsAccessibleWrap(nsIDOMNode* aNode,
nsAccessibleWrap::~nsAccessibleWrap() nsAccessibleWrap::~nsAccessibleWrap()
{ {
NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called");
#ifdef MAI_LOGGING #ifdef MAI_LOGGING
++mAccWrapDeleted; ++mAccWrapDeleted;

View File

@ -46,5 +46,11 @@ nsNativeRootAccessibleWrap::nsNativeRootAccessibleWrap(AtkObject *aAccessible):
nsRootAccessible(nsnull, nsnull) nsRootAccessible(nsnull, nsnull)
{ {
g_object_ref(aAccessible); g_object_ref(aAccessible);
nsAccessibleWrap::mAtkObject = aAccessible; mAtkObject = aAccessible;
}
nsNativeRootAccessibleWrap::~nsNativeRootAccessibleWrap()
{
g_object_unref(mAtkObject);
mAtkObject = nsnull;
} }

View File

@ -55,6 +55,7 @@ class nsNativeRootAccessibleWrap: public nsRootAccessible
{ {
public: public:
nsNativeRootAccessibleWrap(AtkObject *aAccessible); nsNativeRootAccessibleWrap(AtkObject *aAccessible);
~nsNativeRootAccessibleWrap();
}; };
#endif /* __NS_ROOT_ACCESSIBLE_WRAP_H__ */ #endif /* __NS_ROOT_ACCESSIBLE_WRAP_H__ */