From: Mikko Rasa Date: Fri, 26 Aug 2016 23:27:16 +0000 (+0300) Subject: Notify watchers of a resource being removed from the manager X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=94b4a4933e2fcb178ab580009b47db76abd53e0a;p=libs%2Fgl.git Notify watchers of a resource being removed from the manager Most likely this is a consequence of it being deleted. --- diff --git a/source/resourcemanager.cpp b/source/resourcemanager.cpp index 57b03273..6b4f0f24 100644 --- a/source/resourcemanager.cpp +++ b/source/resourcemanager.cpp @@ -163,6 +163,9 @@ void ResourceManager::remove_resource(Resource &r) else if(state>ManagedResource::LOAD_QUEUED && state::const_iterator i=managed.watchers.begin(); i!=managed.watchers.end(); ++i) + (*i)->resource_removed(r); + MutexLock lock(map_mutex); remove_existing(resources, &r); } diff --git a/source/resourcewatcher.h b/source/resourcewatcher.h index 1f5718ec..47dc7983 100644 --- a/source/resourcewatcher.h +++ b/source/resourcewatcher.h @@ -15,6 +15,7 @@ public: virtual void resource_loaded(Resource &) { } virtual void resource_unloaded(Resource &) { } + virtual void resource_removed(Resource &) { } }; } // namespace GL