Cvpcb: fix possible crash when pressing the ESC key during some calculations.
From master branch, commit b1c67d9
This commit is contained in:
parent
2975e85950
commit
73193196d2
|
@ -125,6 +125,7 @@ CVPCB_MAINFRAME::CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_libListBox = NULL;
|
||||
m_mainToolBar = NULL;
|
||||
m_modified = false;
|
||||
m_cannotClose = false;
|
||||
m_skipComponentSelect = false;
|
||||
m_filteringOptions = 0;
|
||||
m_tcFilterString = NULL;
|
||||
|
@ -307,6 +308,10 @@ void CVPCB_MAINFRAME::OnCloseWindow( wxCloseEvent& Event )
|
|||
// clear highlight symbol in schematic:
|
||||
SendMessageToEESCHEMA( true );
|
||||
|
||||
|
||||
if( m_cannotClose )
|
||||
return;
|
||||
|
||||
// Delete window
|
||||
Destroy();
|
||||
}
|
||||
|
@ -1117,7 +1122,11 @@ void CVPCB_MAINFRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
|||
switch( mail.Command() )
|
||||
{
|
||||
case MAIL_EESCHEMA_NETLIST:
|
||||
// Disable Close events during ReadNetListAndFpFiles() to avoid crash when updating
|
||||
// widgets:
|
||||
m_cannotClose = true;
|
||||
ReadNetListAndFpFiles( payload );
|
||||
m_cannotClose = false;
|
||||
/* @todo
|
||||
Go into SCH_EDIT_FRAME::OnOpenCvpcb( wxCommandEvent& event ) and trim GNL_ALL down.
|
||||
*/
|
||||
|
|
|
@ -85,6 +85,8 @@ protected:
|
|||
PARAM_CFG_ARRAY m_projectFileParams;
|
||||
|
||||
bool m_initialized;
|
||||
bool m_cannotClose; // true when the cvpcb frame cannot be closed
|
||||
// (mainly during reading a netlist sent by Eeschema)
|
||||
|
||||
CVPCB_MAINFRAME( KIWAY* aKiway, wxWindow* aParent );
|
||||
|
||||
|
|
Loading…
Reference in New Issue