Пример #1
0
		void close() {
			if (hQuery_ == NULL)
				throw pdh_exception("query is null!");
			PDH::PDHFactory::get_impl()->remove_listener(this);
			on_unload();
			counters_.clear();
		}
Пример #2
0
ResourceManager::~ResourceManager()
{
	const ResourceMap::Entry* begin = sort_map::begin(_rm);
	const ResourceMap::Entry* end = sort_map::end(_rm);

	for (; begin != end; begin++)
	{
		const StringId64 type = begin->pair.first.type;
		const StringId64 name = begin->pair.first.name;
		on_offline(type, name);
		on_unload(type, begin->pair.second.data);
	}
}
Пример #3
0
	/** self **/
	void ApplicationBase::run(const int argc, const char** argv){
		OPH();
		// on load
		if(!on_load(argc, argv)){
			ERROR("Core load failed");
			return;
		}

		// run
		ProcessLocal* process =ProcessLocal::Instance();
		while(process->update());

		// on unload
		on_unload();
	}
Пример #4
0
void ResourceManager::unload(StringId64 type, StringId64 name)
{
	flush();

	ResourcePair id = { type, name };
	ResourceEntry& entry = sort_map::get(_rm, id, ResourceEntry::NOT_FOUND);

	if (--entry.references == 0)
	{
		on_offline(type, name);
		on_unload(type, entry.data);

		sort_map::remove(_rm, id);
		sort_map::sort(_rm);
	}
}