From 45da2a9b2dd3b71126894999e9fba04f7b1d3ce0 Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Fri, 26 Jun 2015 01:10:46 -0400 Subject: [PATCH] Made JsonWriterFile flush on destruct --- demboyz/base/jsonfile.cpp | 5 +++++ demboyz/base/jsonfile.h | 1 + 2 files changed, 6 insertions(+) diff --git a/demboyz/base/jsonfile.cpp b/demboyz/base/jsonfile.cpp index a7a4b4b..442df5f 100644 --- a/demboyz/base/jsonfile.cpp +++ b/demboyz/base/jsonfile.cpp @@ -12,6 +12,11 @@ namespace base { } + JsonWriterFile::~JsonWriterFile() + { + Flush(); + } + FILE* JsonWriterFile::GetFp() const { return m_fp; diff --git a/demboyz/base/jsonfile.h b/demboyz/base/jsonfile.h index 5164bd9..10c9aca 100644 --- a/demboyz/base/jsonfile.h +++ b/demboyz/base/jsonfile.h @@ -13,6 +13,7 @@ namespace base { public: JsonWriterFile(FILE* fp, char* buffer, std::size_t length); + ~JsonWriterFile(); FILE* GetFp() const; void Flush();