From ce28e056c20bf2723f565bbf464b87781ec248a2 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:45:42 -0500 Subject: Second Life viewer sources 1.20.2 --- linden/indra/llcommon/llfile.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'linden/indra/llcommon/llfile.cpp') diff --git a/linden/indra/llcommon/llfile.cpp b/linden/indra/llcommon/llfile.cpp index d551f28..32e9622 100644 --- a/linden/indra/llcommon/llfile.cpp +++ b/linden/indra/llcommon/llfile.cpp @@ -272,9 +272,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, @@ -286,7 +288,8 @@ llofstream::llofstream(const char *_Filename, } llofstream::~llofstream() -{ // destroy the object +{ + // destroy the object if (_ShouldClose) { close(); -- cgit v1.1