Bug 536567 - call InitUploadLastDir only when needed. r=ehsan

This commit is contained in:
Geoff Lankow 2010-02-21 15:52:51 +01:00
parent 1fef158783
commit 532283056f
2 changed files with 5 additions and 3 deletions

View File

@ -291,8 +291,6 @@ nsLayoutStatics::Initialize()
NS_SealStaticAtomTable();
nsFileControlFrame::InitUploadLastDir();
return NS_OK;
}

View File

@ -165,6 +165,9 @@ nsFileControlFrame::Init(nsIContent* aContent,
mMouseListener = new MouseListener(this);
NS_ENSURE_TRUE(mMouseListener, NS_ERROR_OUT_OF_MEMORY);
if (!gUploadLastDir)
nsFileControlFrame::InitUploadLastDir();
return rv;
}
@ -498,7 +501,8 @@ void nsFileControlFrame::InitUploadLastDir() {
}
void nsFileControlFrame::DestroyUploadLastDir() {
NS_RELEASE(gUploadLastDir);
if (gUploadLastDir)
NS_RELEASE(gUploadLastDir);
}
UploadLastDir::UploadLastDir():