Freeze the adapter to avoid invalid deref

GTK tries to get the parent item of selected elements when unselecting.
If we don't freeze, we run the risk of crashing if a selected item is
removed before being unselected.  This causes a wx warning but a) this
is suppressed in release and b) warning message is better than crash.
See next commit for fix to avoid common case of the error
This commit is contained in:
Seth Hillbrand 2024-06-14 14:59:14 -07:00
parent db9f0a0358
commit 9f4dfe77cb
1 changed files with 2 additions and 0 deletions

View File

@ -354,7 +354,9 @@ void LIB_TREE::CenterLibId( const LIB_ID& aLibId )
void LIB_TREE::Unselect() void LIB_TREE::Unselect()
{ {
m_tree_ctrl->Freeze();
m_tree_ctrl->UnselectAll(); m_tree_ctrl->UnselectAll();
m_tree_ctrl->Thaw();
} }