Don't let the config_cache singleton use a static member.
The static member is now a static variable in the instance function. This avoids the static initialization fiasco with the logger in the clear_defines() function. The problem was discovered by Pietro_S.
This commit is contained in:
parent
cb9c05f1bc
commit
2d93ddbadd
2 changed files with 2 additions and 4 deletions
|
@ -33,11 +33,11 @@
|
|||
#define DBG_CACHE LOG_STREAM(debug, cache)
|
||||
|
||||
namespace game_config {
|
||||
config_cache config_cache::cache_;
|
||||
|
||||
config_cache& config_cache::instance()
|
||||
{
|
||||
return cache_;
|
||||
static config_cache cache;
|
||||
return cache;
|
||||
}
|
||||
|
||||
config_cache::config_cache() :
|
||||
|
|
|
@ -98,8 +98,6 @@ namespace game_config {
|
|||
typedef std::multimap<std::string,std::string> path_define_map;
|
||||
private:
|
||||
|
||||
static config_cache cache_;
|
||||
|
||||
bool force_valid_cache_, use_cache_, not_valid_cache_;
|
||||
preproc_map defines_map_;
|
||||
path_define_map path_defines_;
|
||||
|
|
Loading…
Add table
Reference in a new issue