зеркало из https://github.com/mozilla/pjs.git
Memory Leak fixes
This commit is contained in:
Родитель
674c289b46
Коммит
3c14143542
|
@ -137,7 +137,10 @@ nsXPFCCanvas :: ~nsXPFCCanvas()
|
|||
}
|
||||
|
||||
if (nsnull != mView)
|
||||
{
|
||||
mView->SetParent(nsnull);
|
||||
mView->Destroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -607,8 +610,6 @@ nsresult nsXPFCCanvas :: LoadView(const nsCID &aViewClassIID,
|
|||
else if (GetParent() != nsnull)
|
||||
view = GetParent()->GetView();
|
||||
|
||||
nsViewClip clip ;
|
||||
|
||||
mView->Init(gXPFCToolkit->GetViewManager(),
|
||||
bounds,
|
||||
view,
|
||||
|
|
|
@ -33,8 +33,23 @@ nsXPFCToolbarManager :: nsXPFCToolbarManager()
|
|||
|
||||
nsXPFCToolbarManager :: ~nsXPFCToolbarManager()
|
||||
{
|
||||
if (mToolbars != nsnull)
|
||||
{
|
||||
if (mToolbars != nsnull) {
|
||||
|
||||
nsIIterator * iterator;
|
||||
|
||||
mToolbars->CreateIterator(&iterator);
|
||||
iterator->Init();
|
||||
|
||||
nsIXPFCToolbar * item;
|
||||
|
||||
while(!(iterator->IsDone()))
|
||||
{
|
||||
item = (nsIXPFCToolbar *) iterator->CurrentItem();
|
||||
NS_RELEASE(item);
|
||||
iterator->Next();
|
||||
}
|
||||
NS_RELEASE(iterator);
|
||||
|
||||
mToolbars->RemoveAll();
|
||||
NS_RELEASE(mToolbars);
|
||||
}
|
||||
|
@ -64,6 +79,7 @@ nsresult nsXPFCToolbarManager :: Init()
|
|||
nsresult nsXPFCToolbarManager :: AddToolbar(nsIXPFCToolbar * aToolbar)
|
||||
{
|
||||
mToolbars->Append(aToolbar);
|
||||
NS_ADDREF(aToolbar);
|
||||
return NS_OK ;
|
||||
}
|
||||
|
||||
|
|
|
@ -357,7 +357,7 @@ NS_IMETHODIMP nsXPFCXMLContentSink::OpenContainer(const nsIParserNode& aNode)
|
|||
}
|
||||
|
||||
// XXX: Really need this for all states
|
||||
if (mState == XPFC_PARSING_STATE_MENUBAR)
|
||||
if (mState == XPFC_PARSING_STATE_MENUBAR || mState == XPFC_PARSING_STATE_TOOLBAR)
|
||||
NS_RELEASE(object);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -454,7 +454,7 @@ NS_IMETHODIMP nsXPFCXMLContentSink::AddLeaf(const nsIParserNode& aNode)
|
|||
}
|
||||
|
||||
// XXX: Really need this for all states
|
||||
if (mState == XPFC_PARSING_STATE_MENUBAR)
|
||||
if (mState == XPFC_PARSING_STATE_MENUBAR || mState == XPFC_PARSING_STATE_TOOLBAR)
|
||||
NS_RELEASE(object);
|
||||
|
||||
return NS_OK;
|
||||
|
@ -817,6 +817,7 @@ NS_IMETHODIMP nsXPFCXMLContentSink::AddToHierarchy(nsIXMLParserObject& aObject,
|
|||
mXPFCStack->Push(child_canvas);
|
||||
|
||||
NS_IF_RELEASE(child_canvas);
|
||||
NS_IF_RELEASE(container);
|
||||
|
||||
return NS_OK;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче