starting to clean up ownership model

This commit is contained in:
saari%netscape.com 1999-04-26 20:56:08 +00:00
parent 7bae157253
commit 0b9c5ff3df

View File

@ -116,17 +116,18 @@ NS_METHOD nsMenuBar::Create(nsIWidget *aParent)
NS_METHOD nsMenuBar::GetParent(nsIWidget *&aParent)
{
aParent = mParent;
NS_IF_ADDREF(aParent);
// Bad monkey. Don't addref parent since we don't own the parent
//NS_IF_ADDREF(aParent);
return NS_OK;
}
//-------------------------------------------------------------------------
NS_METHOD nsMenuBar::SetParent(nsIWidget *aParent)
{
NS_IF_RELEASE(mParent);
// We don't own the parent, we shouldn't be addrefing it
//NS_IF_RELEASE(mParent);
mParent = aParent;
NS_IF_ADDREF(mParent);
//NS_IF_ADDREF(mParent);
return NS_OK;
}