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:
parent
db9f0a0358
commit
9f4dfe77cb
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue