From: Mikko Rasa Date: Fri, 27 Nov 2015 06:30:52 +0000 (+0200) Subject: Decrement size when removing a resource from the loading thread X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ca450e5f2a5da6375d12190123d1acd35580ac15;p=libs%2Fgl.git Decrement size when removing a resource from the loading thread --- diff --git a/source/resourcemanager.cpp b/source/resourcemanager.cpp index 7d5d752b..bcc4839b 100644 --- a/source/resourcemanager.cpp +++ b/source/resourcemanager.cpp @@ -440,12 +440,18 @@ bool ResourceManager::LoadingThread::try_remove_resource(ManagedResource &r) { i = find(sync_queue.begin(), sync_queue.end(), &r); if(i!=sync_queue.end()) + { sync_queue.erase(i); + --size; + } } else if(i==async_queue.begin()) return false; else + { async_queue.erase(i); + --size; + } return true; }