mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
IPC_API: fix crash in PLUGIN_AVAILABILITY_CHANGED event handler (schematic)
Re-opening SCH while the PCB is open leads to crash. Same as 441b2686d3150b1c3e0629c3d49857f1c47e3871, but for schematic editor.
This commit is contained in:
parent
b2aee0bf74
commit
cabf7d4878
@ -189,12 +189,7 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
|
||||
#ifdef KICAD_IPC_API
|
||||
wxTheApp->Bind( EDA_EVT_PLUGIN_AVAILABILITY_CHANGED,
|
||||
[&]( wxCommandEvent& aEvt )
|
||||
{
|
||||
wxLogTrace( traceApi, "SCH frame: EDA_EVT_PLUGIN_AVAILABILITY_CHANGED" );
|
||||
ReCreateHToolbar();
|
||||
aEvt.Skip();
|
||||
} );
|
||||
&SCH_EDIT_FRAME::onPluginAvailabilityChanged, this );
|
||||
#endif
|
||||
|
||||
m_hierarchy = new HIERARCHY_PANE( this );
|
||||
@ -429,6 +424,12 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||
|
||||
SCH_EDIT_FRAME::~SCH_EDIT_FRAME()
|
||||
{
|
||||
#ifdef KICAD_IPC_API
|
||||
Pgm().GetApiServer().DeregisterHandler( m_apiHandler.get() );
|
||||
wxTheApp->Unbind( EDA_EVT_PLUGIN_AVAILABILITY_CHANGED,
|
||||
&SCH_EDIT_FRAME::onPluginAvailabilityChanged, this );
|
||||
#endif
|
||||
|
||||
m_hierarchy->Unbind( wxEVT_SIZE, &SCH_EDIT_FRAME::OnResizeHierarchyNavigator, this );
|
||||
|
||||
// Ensure m_canvasType is up to date, to save it in config
|
||||
@ -2553,3 +2554,12 @@ void SCH_EDIT_FRAME::updateSelectionFilterVisbility()
|
||||
|
||||
selectionFilterPane.Show( showFilter );
|
||||
}
|
||||
|
||||
#ifdef KICAD_IPC_API
|
||||
void SCH_EDIT_FRAME::onPluginAvailabilityChanged( wxCommandEvent& aEvt )
|
||||
{
|
||||
wxLogTrace( traceApi, "SCH frame: EDA_EVT_PLUGIN_AVAILABILITY_CHANGED" );
|
||||
ReCreateHToolbar();
|
||||
aEvt.Skip();
|
||||
}
|
||||
#endif
|
||||
|
@ -923,6 +923,10 @@ protected:
|
||||
|
||||
void updateSelectionFilterVisbility() override;
|
||||
|
||||
#ifdef KICAD_IPC_API
|
||||
void onPluginAvailabilityChanged( wxCommandEvent& aEvt );
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Called when resizing the Hierarchy Navigator panel
|
||||
void OnResizeHierarchyNavigator( wxSizeEvent& aEvent );
|
||||
|
Loading…
x
Reference in New Issue
Block a user