bugfix: pcbnew crashes when selected component is removed in OpenGL canvas

This commit is contained in:
Maciej Suminski 2015-04-07 18:31:37 +02:00
parent d38c9b205f
commit 78d9e7b789
1 changed files with 6 additions and 0 deletions

View File

@ -48,6 +48,9 @@
#include <pcbnew.h> #include <pcbnew.h>
#include <io_mgr.h> #include <io_mgr.h>
#include <tool/tool_manager.h>
#include <tools/common_actions.h>
void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName, void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
const wxString& aCmpFileName, const wxString& aCmpFileName,
@ -108,6 +111,9 @@ void PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFileName,
} }
} }
// Clear selection, just in case a selected item has to be removed
m_toolManager->RunAction( COMMON_ACTIONS::selectionClear, true );
netlist.SortByReference(); netlist.SortByReference();
board->ReplaceNetlist( netlist, aDeleteSinglePadNets, aReporter ); board->ReplaceNetlist( netlist, aDeleteSinglePadNets, aReporter );