fix build bustage - use comptr to delete obj

This commit is contained in:
ben@bengoodger.com
2005-04-23 02:08:12 +00:00
parent 43e284b229
commit a08217b94c

View File

@@ -218,15 +218,14 @@ nsDirEnumeratorUnix::GetNextFile(nsIFile **_retval)
return NS_OK;
}
nsLocalFile* file = new nsLocalFile();
nsCOMPtr<nsILocalFile> file = new nsLocalFile();
if (!file)
return NS_ERROR_OUT_OF_MEMORY;
if (NS_FAILED(rv = file->InitWithNativePath(mParentPath)) ||
NS_FAILED(rv = file->AppendNative(nsDependentCString(mEntry->d_name)))) {
delete file;
NS_FAILED(rv = file->AppendNative(nsDependentCString(mEntry->d_name))))
return rv;
}
*_retval = file;
NS_ADDREF(*_retval);
return GetNextEntry();