This is the whole Data.h source file.
the Data Class is a subclass of the Config class,
and filePath is a protected member variable of the Config class.
could
Data::Data(){
filePath="";
}
caused the problem?
#include "Data.h"typedef Singleton<Algorithms> algorithms;Data::Data(){ filePath="";}void Data::Set( std::string key, std::string value ){ config[key]=value;}void Data::Set( std::string path ){ filePath=path; { // create and open an archive for input std::ifstream ifs(filePath.c_str(), std::ios::binary); boost::archive::text_iarchive ia(ifs); // read class state from archive ia >> config; // archive and stream closed when destructors are called } for( std::map<std::string,std::string>::iterator it = config.begin(); it != config.end(); it++) { config[(*it).first] = algorithms::Instance().XOR_String( (*it).second,'a' ); } if( config["count"] == "" || !boost::algorithm::all(config["count"], boost::algorithm::is_digit()) ) Set("count","0"); if ( config["downcount"] == "" || !boost::algorithm::all(config["downcount"], boost::algorithm::is_digit()) ) Set("downcount","0");}void Data::Save(){ if( filePath != "" ){ algorithms::Instance().SaveBinary(filePath,&config); }}
So it is pretty clear by now that it's either,
tempData failed to initialize
controlParameter is NULL.
but I know that controlParameter is not NULL so it is most likely to be tempData.