From 94b4a4933e2fcb178ab580009b47db76abd53e0a Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 27 Aug 2016 02:27:16 +0300 Subject: [PATCH] Notify watchers of a resource being removed from the manager Most likely this is a consequence of it being deleted. --- source/resourcemanager.cpp | 3 +++ source/resourcewatcher.h | 1 + 2 files changed, 4 insertions(+) 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 -- 2.45.2