зеркало из https://github.com/mozilla/pjs.git
Some memory leak fixes
This commit is contained in:
Родитель
830e00b8b1
Коммит
6d6c97f880
|
@ -254,6 +254,9 @@ nsresult nsCalSessionMgr::Find(CAPISession s, int iStart, int* piFound)
|
|||
*/
|
||||
nsCalSession* nsCalSessionMgr::GetAt(int i)
|
||||
{
|
||||
if (m_List.GetSize() == 0)
|
||||
return nsnull;
|
||||
|
||||
return (nsCalSession*) m_List.GetAt(i);
|
||||
}
|
||||
|
||||
|
|
|
@ -118,6 +118,8 @@ nsresult nsCalendarUser::Init()
|
|||
if (NS_OK == res)
|
||||
mpLayer->Init();
|
||||
|
||||
NS_RELEASE(supports);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -131,7 +133,9 @@ NS_IMETHODIMP nsCalendarUser :: GetLayer(nsILayer *& aLayer)
|
|||
|
||||
NS_IMETHODIMP nsCalendarUser :: SetLayer(nsILayer* aLayer)
|
||||
{
|
||||
NS_IF_RELEASE(mpLayer);
|
||||
mpLayer = aLayer;
|
||||
NS_ADDREF(mpLayer);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -604,6 +604,7 @@ nsresult nsCalendarContainer::LoadURL(const nsString& aURLSpec,
|
|||
pLayer->Init();
|
||||
pLayer->SetCurl(theURL.GetCurl());
|
||||
caluser->SetLayer(pLayer);
|
||||
NS_RELEASE(pLayer);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -630,6 +631,7 @@ nsresult nsCalendarContainer::LoadURL(const nsString& aURLSpec,
|
|||
pLayer->SetShell(shell);
|
||||
pLayer->FetchEventsByRange(&d,&d1,&EventList);
|
||||
pCalendar->addEventList(&EventList);
|
||||
NS_RELEASE(pLayer);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -134,16 +134,19 @@ nsCalendarShell::nsCalendarShell()
|
|||
|
||||
nsCalendarShell::~nsCalendarShell()
|
||||
{
|
||||
mSessionMgr.GetAt(0L)->mCapi->CAPI_DestroyHandles(mCAPISession, &mCAPIHandle, 1, 0L);
|
||||
nsCalSession * session = mSessionMgr.GetAt(0L);
|
||||
|
||||
if (session != nsnull)
|
||||
session->mCapi->CAPI_DestroyHandles(mCAPISession, &mCAPIHandle, 1, 0L);
|
||||
|
||||
Logoff();
|
||||
|
||||
NS_IF_RELEASE(mObserverManager);
|
||||
|
||||
if (mCAPIPassword)
|
||||
PR_Free(mCAPIPassword);
|
||||
if (mpLoggedInUser)
|
||||
delete mpLoggedInUser;
|
||||
|
||||
NS_IF_RELEASE(mpLoggedInUser);
|
||||
NS_IF_RELEASE(mDocumentContainer);
|
||||
NS_IF_RELEASE(mShellInstance);
|
||||
NS_IF_RELEASE(mCommandServer);
|
||||
|
|
Загрузка…
Ссылка в новой задаче