summaryrefslogtreecommitdiff
path: root/indra/llcommon/llfile.cpp
diff options
context:
space:
mode:
authorMark Lentczner <markl@lindenlab.com>2007-02-06 00:57:33 +0000
committerMark Lentczner <markl@lindenlab.com>2007-02-06 00:57:33 +0000
commitd0d4670f4941dcf7430fb1269c6613140ecf3ff7 (patch)
treee3d6b59c19cac6bc172ec5fb0131ffc8f4923b75 /indra/llcommon/llfile.cpp
parent77f04c74eb1603bf2fadc30127d05378bfc7a48a (diff)
merge in of error-refactor-3
concludes (fixes) SL-31187 pair programmed and reviewed by markl and karen
Diffstat (limited to 'indra/llcommon/llfile.cpp')
-rw-r--r--indra/llcommon/llfile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/llcommon/llfile.cpp b/indra/llcommon/llfile.cpp
index 16e2f5c5a1..4acd94f943 100644
--- a/indra/llcommon/llfile.cpp
+++ b/indra/llcommon/llfile.cpp
@@ -178,6 +178,7 @@ void llifstream::open(const char* _Filename, /* Flawfinder: ignore */
}
llassert(_Filebuffer == NULL);
_Filebuffer = new _Myfb(filep);
+ _ShouldClose = true;
_Myios::init(_Filebuffer);
}
@@ -189,13 +190,17 @@ bool llifstream::is_open() const
}
llifstream::~llifstream()
{
+ if (_ShouldClose)
+ {
+ close();
+ }
delete _Filebuffer;
}
llifstream::llifstream(const char *_Filename,
ios_base::openmode _Mode,
int _Prot)
- : std::basic_istream< char , std::char_traits< char > >(NULL,true),_Filebuffer(NULL)
+ : std::basic_istream< char , std::char_traits< char > >(NULL,true),_Filebuffer(NULL),_ShouldClose(false)
{ // construct with named file and specified mode
open(_Filename, _Mode | ios_base::in, _Prot); /* Flawfinder: ignore */