- bugfixes on windows platform when some folders and files are missing, do not crash hard.
This commit is contained in:
parent
163a5a173a
commit
b6cd751250
|
@ -1470,7 +1470,7 @@ void CoreData::saveGameSettingsToFile(std::string fileName, GameSettings *gameSe
|
|||
}
|
||||
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s] Line: %d\n",__FILE__,__FUNCTION__,__LINE__);
|
||||
}
|
||||
|
|
|
@ -200,7 +200,7 @@ string MenuStateAbout::loadAdditionalCredits(){
|
|||
std::cout << buffer << std::endl;
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -171,14 +171,14 @@ static inline T* readFromFileReaders(vector<FileReader<T> const *>* readers, con
|
|||
if (ret != NULL) {
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
|
@ -223,14 +223,14 @@ static inline T* readFromFileReaders(vector<FileReader<T> const *>* readers, con
|
|||
if (ret != NULL) {
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ T* FileReader<T>::read(const string& filepath) const {
|
|||
T* ret = read(file,filepath);
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
@ -393,7 +393,7 @@ T* FileReader<T>::read(const string& filepath, T* object) const {
|
|||
T* ret = read(file,filepath,object);
|
||||
file.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -883,7 +883,7 @@ void MapPreview::loadFromFile(const string &path) {
|
|||
}
|
||||
}
|
||||
|
||||
fclose(f1);
|
||||
if(f1) fclose(f1);
|
||||
|
||||
fileLoaded = true;
|
||||
mapFileLoaded = path;
|
||||
|
@ -964,7 +964,7 @@ void MapPreview::saveToFile(const string &path) {
|
|||
}
|
||||
}
|
||||
|
||||
fclose(f1);
|
||||
if(f1) fclose(f1);
|
||||
|
||||
hasChanged = false;
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ void AllocRegistry::dump(const char *path) {
|
|||
fprintf(f, "Total allocations: %d, " MG_SIZE_T_SPECIFIER " bytes\n", allocCount, allocBytes);
|
||||
fprintf(f, "Not monitored allocations: %d, " MG_SIZE_T_SPECIFIER " bytes\n", nonMonitoredCount, nonMonitoredBytes);
|
||||
|
||||
fclose(f);
|
||||
if(f) fclose(f);
|
||||
|
||||
printf("Memory leak dump summary at: %s\n",szBuf2);
|
||||
printf("Total leaks: %d, " MG_SIZE_T_SPECIFIER " bytes\n", leakCount, leakBytes);
|
||||
|
|
|
@ -376,7 +376,7 @@ void Properties::save(const string &path){
|
|||
|
||||
fileStream.close();
|
||||
#if defined(WIN32) && !defined(__MINGW32__)
|
||||
fclose(fp);
|
||||
if(fp) fclose(fp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue