]> git.tdb.fi Git - libs/gl.git/commitdiff
Fix the resource disassociation loop in ~ResourceManager
authorMikko Rasa <tdb@tdb.fi>
Fri, 26 Sep 2014 15:01:40 +0000 (18:01 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 26 Sep 2014 15:01:40 +0000 (18:01 +0300)
source/resourcemanager.cpp

index 3456ac887a58f2e77d8e67ca7cf328a6fec8b1be..cdd032264345dae5d81d11bf17f10e3da9ed09d3 100644 (file)
@@ -23,8 +23,8 @@ ResourceManager::~ResourceManager()
 {
        thread.terminate();
 
-       for(ResourceMap::iterator i=resources.begin(); i!=resources.end(); ++i)
-               i->second.resource->set_manager(0);
+       while(!resources.empty())
+               resources.begin()->second.resource->set_manager(0);
 }
 
 void ResourceManager::set_loading_policy(LoadingPolicy p)