Eeschema: fix a crash on closing the schematic editor if the point editor is active.
If the point editor is active and a change is made, the tool was shut down after deleting the board data, in the frame Dtor. Therefore a crash happened because a call to GetScreen()->SetModify(); using a null pointer, and after the test for modifications was done. Now tools are stopped when closing the window, before any test for modifications.
This commit is contained in:
parent
469c1c14ef
commit
b0367f5a34
|
@ -516,6 +516,10 @@ void SCH_EDIT_FRAME::OnCloseWindow( wxCloseEvent& aEvent )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Shutdown all running tools ( and commit any pending change )
|
||||||
|
if( m_toolManager )
|
||||||
|
m_toolManager->ShutdownAllTools();
|
||||||
|
|
||||||
if( Kiface().IsSingle() )
|
if( Kiface().IsSingle() )
|
||||||
{
|
{
|
||||||
LIB_EDIT_FRAME* libeditFrame = (LIB_EDIT_FRAME*) Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
|
LIB_EDIT_FRAME* libeditFrame = (LIB_EDIT_FRAME*) Kiway().Player( FRAME_SCH_LIB_EDITOR, false );
|
||||||
|
@ -621,6 +625,11 @@ wxString SCH_EDIT_FRAME::GetUniqueFilenameForCurrentSheet()
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnModify()
|
void SCH_EDIT_FRAME::OnModify()
|
||||||
{
|
{
|
||||||
|
wxASSERT( GetScreen() );
|
||||||
|
|
||||||
|
if( !GetScreen() )
|
||||||
|
return;
|
||||||
|
|
||||||
GetScreen()->SetModify();
|
GetScreen()->SetModify();
|
||||||
GetScreen()->SetSave();
|
GetScreen()->SetSave();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue