From 7a29b2d1cd471767b58ea30f53900cd2c5a9637c Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:35 -0500 Subject: Second Life viewer sources 1.19.1.1 --- linden/indra/llcommon/llfile.cpp | 8 ++++++-- linden/indra/llcommon/llfile.h | 6 ++++-- linden/indra/llcommon/llversionviewer.h | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'linden/indra/llcommon') diff --git a/linden/indra/llcommon/llfile.cpp b/linden/indra/llcommon/llfile.cpp index 6ccf6ac..d551f28 100644 --- a/linden/indra/llcommon/llfile.cpp +++ b/linden/indra/llcommon/llfile.cpp @@ -266,6 +266,7 @@ void llofstream::open(const char* _Filename, /* Flawfinder: ignore */ } llassert(_Filebuffer==NULL); _Filebuffer = new _Myfb(filep); + _ShouldClose = true; _Myios::init(_Filebuffer); } @@ -279,14 +280,17 @@ void llofstream::close() llofstream::llofstream(const char *_Filename, std::ios_base::openmode _Mode, int _Prot) - : std::basic_ostream >(NULL,true),_Filebuffer(NULL) + : std::basic_ostream >(NULL,true),_Filebuffer(NULL),_ShouldClose(false) { // construct with named file and specified mode open(_Filename, _Mode , _Prot); /* Flawfinder: ignore */ } llofstream::~llofstream() { // destroy the object - close(); + if (_ShouldClose) + { + close(); + } delete _Filebuffer; } diff --git a/linden/indra/llcommon/llfile.h b/linden/indra/llcommon/llfile.h index 2650775..d449ec9 100644 --- a/linden/indra/llcommon/llfile.h +++ b/linden/indra/llcommon/llfile.h @@ -127,7 +127,7 @@ public: typedef std::basic_ios > _Myios; llofstream() - : std::basic_ostream >(NULL,true),_Filebuffer(NULL) + : std::basic_ostream >(NULL,true),_Filebuffer(NULL),_ShouldClose(false) { // construct unopened } @@ -138,7 +138,8 @@ public: explicit llofstream(_Filet *_File) : std::basic_ostream >(NULL,true), - _Filebuffer(new _Myfb(_File))//_File) + _Filebuffer(new _Myfb(_File)),//_File) + _ShouldClose(false) { // construct with specified C stream } @@ -157,6 +158,7 @@ public: private: _Myfb *_Filebuffer; // the file buffer + bool _ShouldClose; }; diff --git a/linden/indra/llcommon/llversionviewer.h b/linden/indra/llcommon/llversionviewer.h index c1e6778..998ea9e 100644 --- a/linden/indra/llcommon/llversionviewer.h +++ b/linden/indra/llcommon/llversionviewer.h @@ -35,7 +35,7 @@ const S32 LL_VERSION_MAJOR = 1; const S32 LL_VERSION_MINOR = 19; const S32 LL_VERSION_PATCH = 1; -const S32 LL_VERSION_BUILD = 0; +const S32 LL_VERSION_BUILD = 1; const char * const LL_CHANNEL = "Second Life Release"; -- cgit v1.1