From: Mikko Rasa Date: Fri, 26 Sep 2014 15:01:40 +0000 (+0300) Subject: Fix the resource disassociation loop in ~ResourceManager X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e9f2bab4927ba3fa146992b648c9716540365b10;p=libs%2Fgl.git Fix the resource disassociation loop in ~ResourceManager --- diff --git a/source/resourcemanager.cpp b/source/resourcemanager.cpp index 3456ac88..cdd03226 100644 --- a/source/resourcemanager.cpp +++ b/source/resourcemanager.cpp @@ -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)