Commit c7116e9d authored by Maciej Suminski's avatar Maciej Suminski

FIxed too late deletion of TOOLs.

parent 87c9423f
...@@ -103,6 +103,14 @@ TOOL_MANAGER::TOOL_MANAGER() : ...@@ -103,6 +103,14 @@ TOOL_MANAGER::TOOL_MANAGER() :
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; std::map<TOOL_BASE*, TOOL_STATE*>::iterator it, it_end;
...@@ -113,7 +121,7 @@ TOOL_MANAGER::~TOOL_MANAGER() ...@@ -113,7 +121,7 @@ TOOL_MANAGER::~TOOL_MANAGER()
delete it->first; // delete the tool itself delete it->first; // delete the tool itself
} }
delete m_actionMgr; m_toolState.clear();
} }
......
...@@ -57,6 +57,11 @@ public: ...@@ -57,6 +57,11 @@ public:
~TOOL_MANAGER(); ~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. * Generates an unique ID from for a tool with given name.
*/ */
......
...@@ -68,6 +68,7 @@ void PCB_EDIT_FRAME::setupTools() ...@@ -68,6 +68,7 @@ void PCB_EDIT_FRAME::setupTools()
void PCB_EDIT_FRAME::destroyTools() void PCB_EDIT_FRAME::destroyTools()
{ {
m_toolManager.DeleteAll();
delete m_toolDispatcher; delete m_toolDispatcher;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment