diff --git a/accessible/src/atk/nsRootAccessibleWrap.cpp b/accessible/src/atk/nsRootAccessibleWrap.cpp index 8d7d4f719c6..f5c353ce48e 100644 --- a/accessible/src/atk/nsRootAccessibleWrap.cpp +++ b/accessible/src/atk/nsRootAccessibleWrap.cpp @@ -51,17 +51,30 @@ nsRootAccessibleWrap::nsRootAccessibleWrap(nsIDOMNode *aDOMNode, nsRootAccessible(aDOMNode, aShell) { MAI_LOG_DEBUG(("New Root Acc=%p\n", (void*)this)); +} + +NS_IMETHODIMP nsRootAccessibleWrap::Init() +{ + nsresult rv = nsRootAccessible::Init(); nsAppRootAccessible *root = nsAppRootAccessible::Create(); - if (root) + if (root) { root->AddRootAccessible(this); + } + return rv; } nsRootAccessibleWrap::~nsRootAccessibleWrap() { MAI_LOG_DEBUG(("Delete Root Acc=%p\n", (void*)this)); +} + +NS_IMETHODIMP nsRootAccessibleWrap::Shutdown() +{ nsAppRootAccessible *root = nsAppRootAccessible::Create(); - if (root) + if (root) { root->RemoveRootAccessible(this); + } + return nsRootAccessible::Shutdown(); } NS_IMETHODIMP nsRootAccessibleWrap::GetParent(nsIAccessible ** aParent) diff --git a/accessible/src/atk/nsRootAccessibleWrap.h b/accessible/src/atk/nsRootAccessibleWrap.h index 8fdfceee901..b042faba10d 100644 --- a/accessible/src/atk/nsRootAccessibleWrap.h +++ b/accessible/src/atk/nsRootAccessibleWrap.h @@ -56,6 +56,8 @@ public: nsRootAccessibleWrap(nsIDOMNode *aDOMNode, nsIWeakReference* aShell); virtual ~nsRootAccessibleWrap(); + NS_IMETHOD Init(); + NS_IMETHOD Shutdown(); NS_IMETHOD GetParent(nsIAccessible ** aParent); NS_IMETHOD GetRole(PRUint32 *aRole); NS_IMETHOD GetExtState(PRUint32 *aState);