FIxed too late deletion of TOOLs.
This commit is contained in:
parent
87c9423f0f
commit
c7116e9d03
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
|
@ -68,6 +68,7 @@ void PCB_EDIT_FRAME::setupTools()
|
|||
|
||||
void PCB_EDIT_FRAME::destroyTools()
|
||||
{
|
||||
m_toolManager.DeleteAll();
|
||||
delete m_toolDispatcher;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue