예제 #1
0
			// Actual resource deletion - This operator is only invoked when the last shared_ptr to
			// the resource (including the shared_ptr inside the cache) is destroyed.
			void operator() (R* pointer)
			{
				AURORA_REQUIRE_COMPLETE_TYPE(R);
				delete pointer;

				// Unregister resource slot, unless cache has been destroyed meanwhile
				std::shared_ptr<ResourceMap> map = mMap.lock();
				if (map)
					map->erase(mIterator);
			}
예제 #2
0
		void operator() (R* pointer)
		{
			// If map element exists, erase it
			if (!tracker.expired())
			{
				// Verify resource ID is still there
				assert(element.map->find(element.itr->first) != element.map->end());
				element.map->erase(element.itr);
			}

			// Perform actual deallocation
			AURORA_REQUIRE_COMPLETE_TYPE(R);
			delete pointer;
		}