FIxed too late deletion of TOOLs.

This commit is contained in:
Maciej Suminski 2014-03-21 17:55:46 +01:00
parent 87c9423f0f
commit c7116e9d03
3 changed files with 15 additions and 1 deletions

View File

@ -103,6 +103,14 @@ TOOL_MANAGER::TOOL_MANAGER() :
TOOL_MANAGER::~TOOL_MANAGER()
{
DeleteAll();
delete m_actionMgr;
}
void TOOL_MANAGER::DeleteAll()
{
std::map<TOOL_BASE*, TOOL_STATE*>::iterator it, it_end;
@ -113,7 +121,7 @@ TOOL_MANAGER::~TOOL_MANAGER()
delete it->first; // delete the tool itself
}
delete m_actionMgr;
m_toolState.clear();
}

View File

@ -57,6 +57,11 @@ public:
~TOOL_MANAGER();
/**
* Deletes all the tools that were registered in the TOOL_MANAGER.
*/
void DeleteAll();
/**
* Generates an unique ID from for a tool with given name.
*/

View File

@ -68,6 +68,7 @@ void PCB_EDIT_FRAME::setupTools()
void PCB_EDIT_FRAME::destroyTools()
{
m_toolManager.DeleteAll();
delete m_toolDispatcher;
}