Skip to content

Commit

Permalink
Prevent abnormal exits caused by sizer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
hemiao2023 committed Jan 2, 2025
1 parent 5c55131 commit eba5ce1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/common/wincmn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2484,11 +2484,13 @@ void wxWindowBase::SetContainingSizer(wxSizer* sizer)
{
// This would be caught by the check below too, but give a more clear
// error message in this case.
#if wxDEBUG_LEVEL > 1
wxASSERT_MSG( m_containingSizer != sizer,
wxS("Adding a window to the same sizer twice?") );

wxCHECK_RET( !m_containingSizer,
wxS("Adding a window already in a sizer, detach it first!") );
#endif // wxDEBUG_LEVEL > 1
}

m_containingSizer = sizer;
Expand Down

0 comments on commit eba5ce1

Please sign in to comment.