From e587e144c87b9a26adc3b3b5bfa416b15d12aa6e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 19 Feb 2003 13:44:32 +0000 Subject: [PATCH] prevent from setting min[WH] > max[WH] because this leads to an infinite loop later on and generally doesnt make sense git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/wincmn.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 0a6772b8e9..4b96081219 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -615,6 +615,12 @@ void wxWindowBase::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW), int WXUNUSED(incH)) { + // setting min width greater than max width leads to infinite loops under + // X11 and generally doesn't make any sense, so don't allow it + wxCHECK_RET( (minW == -1 || maxW == -1 || minW <= maxW) && + (minH == -1 || maxH == -1 || minH < maxH), + _T("min width/height must be less than max width/height!") ); + m_minWidth = minW; m_maxWidth = maxW; m_minHeight = minH; -- 2.50.0