Commit c7116e9d authored by Maciej Suminski's avatar Maciej Suminski
Browse files

FIxed too late deletion of TOOLs.

parent 87c9423f
Loading
Loading
Loading
Loading
+9 −1
Original line number Original line Diff line number Diff line
@@ -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()
        delete it->first;           // delete the tool itself
        delete it->first;           // delete the tool itself
    }
    }


    delete m_actionMgr;
    m_toolState.clear();
}
}




+5 −0
Original line number Original line Diff line number Diff line
@@ -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.
     */
     */
+1 −0
Original line number Original line Diff line number Diff line
@@ -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;
}
}