Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2015, 10:41:10 PM (9 years ago)
Author:
landauf
Message:

fixed crash: apparently these static maps get initialized later now that Scope.cc is in core instead of util. using static getters fixed the issue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/singleton/Scope.cc

    r10407 r10412  
    3636namespace orxonox
    3737{
    38     std::map<ScopeID::Value, int> ScopeManager::instanceCounts_s;
    39     std::map<ScopeID::Value, std::set<ScopeListener*> > ScopeManager::listeners_s;
     38    /*static*/ std::map<ScopeID::Value, int>& ScopeManager::getInstanceCounts()
     39    {
     40        static std::map<ScopeID::Value, int> instanceCounts;
     41        return instanceCounts;
     42    }
     43    /*static*/ std::map<ScopeID::Value, std::set<ScopeListener*> >& ScopeManager::getListeners()
     44    {
     45        static std::map<ScopeID::Value, std::set<ScopeListener*> > listeners;
     46        return listeners;
     47    }
    4048}
Note: See TracChangeset for help on using the changeset viewer.