diff --git a/generator/src/INI.cpp b/generator/src/INI.cpp index b6eed4f..70cfe32 100644 --- a/generator/src/INI.cpp +++ b/generator/src/INI.cpp @@ -145,6 +145,7 @@ INI::INI(const std::string &pFile) { /* Something went wrong if you are here */ std::cerr << "[ERROR] Unknown parsing error at line " << lLineCount << " !" << std::endl; + mFileStream.close(); throw INIException(); } @@ -164,6 +165,7 @@ INI::INI(const std::string &pFile) { /* End og tag not found, this INI file is corrupt */ std::cerr << "[ERROR] Found unclosed section tag at line " << lLineCount << " !" << std::endl; + mFileStream.close(); throw INIException(); } @@ -178,6 +180,7 @@ INI::INI(const std::string &pFile) { if(2U != lKeyValue.size()) { std::cerr << "[ERROR] Invalid key/name pair at line " << lLineCount << " !" << std::endl; + mFileStream.close(); throw INIException(); } @@ -189,12 +192,14 @@ INI::INI(const std::string &pFile) { if(std::string::npos != lKey.find(' ')) { std::cerr << "[ERROR] Space in key at line " << lLineCount << std::endl; + mFileStream.close(); throw INIException(); } if(std::string::npos != lValue.find(' ')) { std::cerr << "[ERROR] Space in value at line " << lLineCount << std::endl; + mFileStream.close(); throw INIException(); } @@ -204,6 +209,7 @@ INI::INI(const std::string &pFile) { } std::cout << "[INFO ] Parsed INI file " << pFile << " successfully !" << std::endl; + mFileStream.close(); } INI::~INI() {