mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-22 03:43:58 +00:00
Don't clear the root view manager pointer when the root view is destroyed. Bug
269402, r+sr=roc, a=asa
This commit is contained in:
parent
7028f44696
commit
a36ab5b06d
@ -499,6 +499,9 @@ nsViewManager::~nsViewManager()
|
||||
getter_AddRefs(eventQueue));
|
||||
NS_ASSERTION(nsnull != eventQueue, "Event queue is null");
|
||||
eventQueue->RevokeEvents(this);
|
||||
} else {
|
||||
// We have a strong ref to mRootViewManager
|
||||
NS_IF_RELEASE(mRootViewManager);
|
||||
}
|
||||
|
||||
mInvalidateEventQueue = nsnull;
|
||||
@ -646,19 +649,22 @@ NS_IMETHODIMP nsViewManager::SetRootView(nsIView *aView)
|
||||
mRootView = view;
|
||||
|
||||
if (mRootView) {
|
||||
if (mRootViewManager && mRootViewManager != this) {
|
||||
NS_RELEASE(mRootViewManager);
|
||||
}
|
||||
nsView* parent = mRootView->GetParent();
|
||||
if (parent) {
|
||||
parent->InsertChild(mRootView, nsnull);
|
||||
mRootViewManager = parent->GetViewManager()->RootViewManager();
|
||||
NS_ASSERTION(mRootViewManager != this, "Something's wrong");
|
||||
NS_ADDREF(mRootViewManager);
|
||||
} else {
|
||||
mRootViewManager = this;
|
||||
}
|
||||
|
||||
mRootView->SetZIndex(PR_FALSE, 0, PR_FALSE);
|
||||
} else {
|
||||
// XXXbz not really needed, probably
|
||||
mRootViewManager = this;
|
||||
}
|
||||
// Else don't touch mRootViewManager
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -489,6 +489,7 @@ private:
|
||||
nsISupportsArray *mCompositeListeners;
|
||||
nsCOMPtr<nsIFactory> mRegionFactory;
|
||||
nsView *mRootView;
|
||||
// mRootViewManager is a strong ref unless it equals |this|
|
||||
nsViewManager *mRootViewManager;
|
||||
nsCOMPtr<nsIEventQueueService> mEventQueueService;
|
||||
nsCOMPtr<nsIEventQueue> mSynthMouseMoveEventQueue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user