]> git.tdb.fi Git - libs/gl.git/commitdiff
Notify watchers of a resource being removed from the manager
authorMikko Rasa <tdb@tdb.fi>
Fri, 26 Aug 2016 23:27:16 +0000 (02:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 26 Aug 2016 23:28:13 +0000 (02:28 +0300)
Most likely this is a consequence of it being deleted.

source/resourcemanager.cpp
source/resourcewatcher.h

index 57b0327336b06a8012b0319d35df4a895498168b..6b4f0f2434c79cb44514caffd11b2a507e92911e 100644 (file)
@@ -163,6 +163,9 @@ void ResourceManager::remove_resource(Resource &r)
        else if(state>ManagedResource::LOAD_QUEUED && state<ManagedResource::LOADED)
                thread.remove_resource(managed);
 
+       for(vector<ResourceWatcher *>::const_iterator i=managed.watchers.begin(); i!=managed.watchers.end(); ++i)
+               (*i)->resource_removed(r);
+
        MutexLock lock(map_mutex);
        remove_existing(resources, &r);
 }
index 1f5718ec23755775ba826ceb58cda2b902af16e0..47dc7983d9c99241ef941fdc7438018667b0fdaf 100644 (file)
@@ -15,6 +15,7 @@ public:
 
        virtual void resource_loaded(Resource &) { }
        virtual void resource_unloaded(Resource &) { }
+       virtual void resource_removed(Resource &) { }
 };
 
 } // namespace GL