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:
Mark de Wever 2008-09-28 11:09:48 +00:00
parent cb9c05f1bc
commit 2d93ddbadd
2 changed files with 2 additions and 4 deletions

View file

@ -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() :

View file

@ -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_;