зеркало из https://github.com/mozilla/gecko-dev.git
69862. r=bienvenu sr=scc@mozilla.org. Check and close the file stream in the destructor
This commit is contained in:
Родитель
a91023590b
Коммит
f67645d1d2
|
@ -310,6 +310,14 @@ nsInputFileStream::nsInputFileStream(nsIFileSpec* inSpec)
|
|||
NS_RELEASE(stream);
|
||||
} // nsInputFileStream::nsInputFileStream
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsInputFileStream::~nsInputFileStream()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (is_open())
|
||||
close();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsInputFileStream::AssignFrom(nsISupports* stream)
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
@ -337,6 +345,13 @@ nsOutputFileStream::nsOutputFileStream(nsIFileSpec* inSpec)
|
|||
NS_RELEASE(stream);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------
|
||||
nsOutputFileStream::~nsOutputFileStream()
|
||||
//----------------------------------------------------------------------------------------
|
||||
{
|
||||
if (is_open())
|
||||
close();
|
||||
}
|
||||
//----------------------------------------------------------------------------------------
|
||||
void nsOutputFileStream::AssignFrom(nsISupports* stream)
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
|
|
@ -481,6 +481,7 @@ public:
|
|||
int nsprMode = kDefaultMode,
|
||||
PRIntn accessMode = 00666);
|
||||
nsInputFileStream(nsIFileSpec* inFile);
|
||||
virtual ~nsInputFileStream();
|
||||
|
||||
void Open(
|
||||
const nsFileSpec& inFile,
|
||||
|
@ -606,6 +607,7 @@ public:
|
|||
NS_RELEASE(stream);
|
||||
}
|
||||
nsOutputFileStream(nsIFileSpec* inFile);
|
||||
virtual ~nsOutputFileStream();
|
||||
|
||||
virtual void flush();
|
||||
virtual void abort();
|
||||
|
|
Загрузка…
Ссылка в новой задаче