nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(parentPresShell);
nsCOMPtr<nsIWeakReference> wr(do_GetWeakReference(parentPresShell));
PRBool nsDOMTreeWalker::GetParent(){  if (!mDOMNode)  {    mAccessible = nsnull;    return PR_FALSE;  }  // do we already have an accessible? Ask it.  if (mAccessible)  {    nsCOMPtr<nsIAccessible> acc;    nsresult rv = mAccessible->GetAccParent(getter_AddRefs(acc));    if (NS_SUCCEEDED(rv) && acc) {      mAccessible = acc;      acc->AccGetDOMNode(getter_AddRefs(mDOMNode));      return PR_TRUE;    }  }  nsCOMPtr<nsIDOMNode> parent;  mDOMNode->GetParentNode(getter_AddRefs(parent));  // if no parent then we hit the root  // we want to return the accessible outside of us. So walk out of   // the document if we can  if (!parent) {    nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mPresShell));    if (presShell) {      nsCOMPtr<nsIPresShell> parentPresShell;      nsCOMPtr<nsIContent> content;      if (NS_SUCCEEDED(nsAccessible::GetParentPresShellAndContent(presShell,                                                    getter_AddRefs(parentPresShell),                                                    getter_AddRefs(content)))) {        nsIFrame* frame;        parentPresShell->GetPrimaryFrameFor(content, &frame);        if (frame) {          nsCOMPtr<nsIAccessible> accessible;          frame->GetAccessible(getter_AddRefs(accessible));          if (!accessible)            accessible = do_QueryInterface(content);          if (accessible) {            nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(parentPresShell);            accessible->AccGetDOMNode(getter_AddRefs(mDOMNode));            mAccessible = accessible;            mPresShell = wr;            return PR_TRUE;          }        }      }      mAccessible = new nsRootAccessible(mPresShell);      mAccessible->AccGetDOMNode(getter_AddRefs(mDOMNode));      return PR_TRUE;    }        mAccessible = nsnull;    mDOMNode = nsnull;    return PR_FALSE;  }  mDOMNode = parent;  if (GetAccessible())     return PR_TRUE;    return GetParent();}