From 04611efae8a3291ceba8a29dd920bdae0d404830 Mon Sep 17 00:00:00 2001 From: Mark Palange Date: Fri, 14 Mar 2008 23:21:38 +0000 Subject: [NOTE: This was an erroneous commit, and was reverted in the next revision] QAR-369 - viewer-cleanup2-7 81916 merged into release. --- indra/llcommon/llfile.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/llcommon/llfile.cpp') 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; } -- cgit v1.2.3