TopBar: Use RemoveChild() instead of Reparent() during of remove of buttons from TopBar.

Note: Under OSX Reparent() causes a crash. [SPE-2210]
This commit is contained in:
YuSanka 2024-04-04 12:42:32 +02:00 committed by Lukas Matena
parent 64267d8f5d
commit b8620d1164

View File

@ -493,7 +493,9 @@ void TopBarItemsCtrl::RemovePage(size_t n)
ScalableButton* btn = m_pageButtons[n];
m_pageButtons.erase(m_pageButtons.begin() + n);
m_buttons_sizer->Remove(n);
btn->Reparent(nullptr);
// Under OSX call of btn->Reparent(nullptr) causes a crash, so as a workaround use RemoveChild() instead
this->RemoveChild(btn);
btn->Destroy();
m_sizer->Layout();
}