]> git.tdb.fi Git - libs/gl.git/commitdiff
Decrement size when removing a resource from the loading thread
authorMikko Rasa <tdb@tdb.fi>
Fri, 27 Nov 2015 06:30:52 +0000 (08:30 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 27 Nov 2015 06:30:52 +0000 (08:30 +0200)
source/resourcemanager.cpp

index 7d5d752b2351a3607e17b953212d981cde1c1792..bcc4839b6b6073cb5b356c16aa4be3c261522023 100644 (file)
@@ -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;
 }