summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llfile.cpp')
-rw-r--r--indra/llcommon/llfile.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 2a18e5c64c..c44650009d 100644
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -271,9 +271,11 @@ void llofstream::open(const char* _Filename, /* Flawfinder: ignore */
void llofstream::close()
{ // close the C stream
- llassert(_Filebuffer);
- if (_Filebuffer->close() == 0)
- _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/
+ if(is_open())
+ {
+ if (_Filebuffer->close() == 0)
+ _Myios::setstate(ios_base::failbit); /*Flawfinder: ignore*/
+ }
}
llofstream::llofstream(const char *_Filename,
@@ -285,7 +287,8 @@ llofstream::llofstream(const char *_Filename,
}
llofstream::~llofstream()
-{ // destroy the object
+{
+ // destroy the object
close();
delete _Filebuffer;
}