コード例 #1
0
void EventManager::shutdownModule()
{
	rMessage() << "EventManager: shutting down." << std::endl;
	saveEventListToRegistry();

	_handlers.clear();
	_dialogWindows.clear();
	_accelerators.clear();
	_events.clear();

	_accelGroup.reset();
}
コード例 #2
0
ファイル: EventManager.cpp プロジェクト: chrisglass/ufoai
	// Destructor, free all allocated objects and un-reference the GTK accelerator group
	~EventManager() {
		g_object_unref(_accelGroup);

		saveEventListToRegistry();

		// Remove all accelerators from the heap
		for (AcceleratorList::iterator i = _accelerators.begin(); i != _accelerators.end(); i++) {
			Accelerator* accelerator = (*i);
			delete accelerator;
		}
		_accelerators.clear();

		// Remove all commands from the heap
		for (EventMap::iterator i = _events.begin(); i != _events.end(); i++) {
			IEvent* event = i->second;
			delete event;
		}
		_events.clear();

		globalOutputStream() << "EventManager successfully shut down.\n";
	}