Perform tool reset twice when reloading a board

The first one is to remove any references to the removed items, the
second one is to setup the new model.

Fixes: lp:1692257
* https://bugs.launchpad.net/kicad/+bug/1692257
This commit is contained in:
Maciej Suminski 2017-07-31 15:07:55 +02:00
parent 76bd05a69b
commit 67ae5935d6
1 changed files with 5 additions and 5 deletions

View File

@ -55,13 +55,13 @@ void PCB_BASE_EDIT_FRAME::SetBoard( BOARD* aBoard )
{
bool new_board = ( aBoard != m_Pcb );
// The active tool might store a reference to the BOARD that is about to be deleted.
if( m_toolManager )
m_toolManager->DeactivateTool();
// It has to be done before the previous board is destroyed by SetBoard()
if( new_board )
{
if( m_toolManager )
m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD );
GetGalCanvas()->GetView()->Clear();
}
PCB_BASE_FRAME::SetBoard( aBoard );