зеркало из https://github.com/mozilla/pjs.git
fix for bug 124497 - leaking nsLocalFile objects - the copy constructor was copying the refcount to the new object
so the new object would always leak r=dbradley, sr=darin, a=asa
This commit is contained in:
Родитель
58a43e4b0d
Коммит
ac827509dc
|
@ -654,9 +654,13 @@ nsLocalFile::Clone(nsIFile **file)
|
|||
*file = nsnull;
|
||||
|
||||
// Just copy-construct ourselves
|
||||
nsCOMPtr<nsILocalFile> localFile = new nsLocalFile(*this);
|
||||
nsLocalFile *localFile = new nsLocalFile(*this);
|
||||
if (localFile == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
// don't forget to re-initialize mRefCnt
|
||||
// or the new object will have the old refcnt
|
||||
localFile->mRefCnt = 0;
|
||||
|
||||
*file = localFile;
|
||||
NS_ADDREF(*file);
|
||||
|
|
Загрузка…
Ссылка в новой задаче