mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Attempt to fix destruction order crash (KICAD-6KC).
This commit is contained in:
parent
0d013498ef
commit
a7fdea9b6f
@ -281,7 +281,20 @@ LIB_TREE::~LIB_TREE()
|
|||||||
m_details_ctrl->Unbind( wxEVT_HTML_LINK_CLICKED, &LIB_TREE::onDetailsLink, this );
|
m_details_ctrl->Unbind( wxEVT_HTML_LINK_CLICKED, &LIB_TREE::onDetailsLink, this );
|
||||||
|
|
||||||
m_hoverTimer.Stop();
|
m_hoverTimer.Stop();
|
||||||
destroyPreview();
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void LIB_TREE::ShutdownPreviews()
|
||||||
|
{
|
||||||
|
m_hoverTimer.Stop();
|
||||||
|
m_previewDisabled = true;
|
||||||
|
|
||||||
|
if( m_previewWindow )
|
||||||
|
{
|
||||||
|
m_previewWindow->Hide();
|
||||||
|
m_previewWindow->Destroy();
|
||||||
|
m_previewWindow = nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -754,18 +767,6 @@ void LIB_TREE::hidePreview()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LIB_TREE::destroyPreview()
|
|
||||||
{
|
|
||||||
hidePreview();
|
|
||||||
|
|
||||||
if( m_previewWindow )
|
|
||||||
{
|
|
||||||
m_previewWindow->Destroy();
|
|
||||||
m_previewWindow = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void LIB_TREE::onIdle( wxIdleEvent& aEvent )
|
void LIB_TREE::onIdle( wxIdleEvent& aEvent )
|
||||||
{
|
{
|
||||||
// The wxDataViewCtrl won't give us its mouseMoved events so we're forced to use idle
|
// The wxDataViewCtrl won't give us its mouseMoved events so we're forced to use idle
|
||||||
|
@ -687,6 +687,9 @@ bool SYMBOL_EDIT_FRAME::canCloseWindow( wxCloseEvent& aEvent )
|
|||||||
|
|
||||||
void SYMBOL_EDIT_FRAME::doCloseWindow()
|
void SYMBOL_EDIT_FRAME::doCloseWindow()
|
||||||
{
|
{
|
||||||
|
if( GetLibTree() )
|
||||||
|
GetLibTree()->ShutdownPreviews();
|
||||||
|
|
||||||
Destroy();
|
Destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,6 +180,8 @@ public:
|
|||||||
m_previewDisabled = aBlock;
|
m_previewDisabled = aBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShutdownPreviews();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* Expand or collapse a node, switching it to the opposite state.
|
* Expand or collapse a node, switching it to the opposite state.
|
||||||
@ -232,7 +234,6 @@ protected:
|
|||||||
|
|
||||||
void showPreview( wxDataViewItem aItem );
|
void showPreview( wxDataViewItem aItem );
|
||||||
void hidePreview();
|
void hidePreview();
|
||||||
void destroyPreview();
|
|
||||||
|
|
||||||
void onQueryText( wxCommandEvent& aEvent );
|
void onQueryText( wxCommandEvent& aEvent );
|
||||||
void onQueryCharHook( wxKeyEvent& aEvent );
|
void onQueryCharHook( wxKeyEvent& aEvent );
|
||||||
|
@ -930,6 +930,9 @@ void FOOTPRINT_EDIT_FRAME::doCloseWindow()
|
|||||||
GetCanvas()->SetEventDispatcher( nullptr );
|
GetCanvas()->SetEventDispatcher( nullptr );
|
||||||
GetCanvas()->StopDrawing();
|
GetCanvas()->StopDrawing();
|
||||||
|
|
||||||
|
if( GetLibTree() )
|
||||||
|
GetLibTree()->ShutdownPreviews();
|
||||||
|
|
||||||
// Do not show the layer manager during closing to avoid flicker
|
// Do not show the layer manager during closing to avoid flicker
|
||||||
// on some platforms (Windows) that generate useless redraw of items in
|
// on some platforms (Windows) that generate useless redraw of items in
|
||||||
// the Layer Manager
|
// the Layer Manager
|
||||||
|
Loading…
x
Reference in New Issue
Block a user