mirror of
https://github.com/glest/glest-source.git
synced 2025-08-23 00:12:49 +02:00
* quick-fix for static initialisation problem in ImageReaders
* fix error in two part NetworkMessageCommandList receive
This commit is contained in:
@@ -265,7 +265,7 @@ T* FileReader<T>::read(const string& filepath, T* object) const {
|
||||
if (!file.is_open()) { //An error occured; TODO: Which one - throw an exception, print error message?
|
||||
throw runtime_error("Could not open file " + filepath);
|
||||
}
|
||||
read(file,filepath,object);
|
||||
return read(file,filepath,object);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -31,7 +31,8 @@ namespace ImageRegisterer {
|
||||
bool registerImageReaders();
|
||||
|
||||
//Since you can't call void methods here, I have used a method doing nothing except initializing the image Readers
|
||||
static bool readersRegistered = registerImageReaders(); //should always return true, this should guarantee that the readers are registered <--> ImageReaders is included anywhere
|
||||
// this static initialisation relies on other static initialisations. == bad! [was quick-fixed, registerImageReaders() is called from main()]
|
||||
// static bool readersRegistered = registerImageReaders(); //should always return true, this should guarantee that the readers are registered <--> ImageReaders is included anywhere
|
||||
}
|
||||
|
||||
}} //end namespace
|
||||
|
Reference in New Issue
Block a user