if (mLocation) {  mLocation->SetDocShell(nsnull); }
WindowStateHolder::~WindowStateHolder(){  if (mInnerWindow) {    // This window was left in the bfcache and is now going away. We need to    // free it up.    nsCOMPtr<nsIThreadJSContextStack> stack(do_GetService(sJSStackContractID));    JSContext *cx = nsnull;    if (stack)      stack->GetSafeJSContext(&cx);    if (!cx) {      NS_WARNING("Trusting GC to finish cleaning up this inner window");      return;    }    mInnerWindow->FreeInnerObjects(cx);    if (mLocation) {      // Don't leave the weak reference to the docshell lying around.      mLocation->SetDocShell(nsnull);    }  }}