X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8adc196b0e9581f2d731710200d104b10b135c98..0b6db82f16ca890ec696d3ed71f1bdb56e649f10:/src/generic/scrlwing.cpp diff --git a/src/generic/scrlwing.cpp b/src/generic/scrlwing.cpp index 94a3d59f5f..7c21cb2f1d 100644 --- a/src/generic/scrlwing.cpp +++ b/src/generic/scrlwing.cpp @@ -649,8 +649,13 @@ void wxScrollHelper::AdjustScrollbars() // it here for now but it would be better to ensure that all ports // generate EVT_SIZE when scrollbars [dis]appear, emulating it if // necessary, and remove it later + // JACS: Stop potential infinite loop by limiting number of iterations + int iterationCount = 0; + const int iterationMax = 5; do { + iterationCount ++; + GetTargetSize(&w, 0); // scroll lines per page: if 0, no scrolling is needed @@ -762,7 +767,7 @@ void wxScrollHelper::AdjustScrollbars() oldh = h; GetTargetSize( &w, &h ); - } while ( w != oldw || h != oldh ); + } while ( (w != oldw || h != oldh) && (iterationCount < iterationMax) ); #ifdef __WXMOTIF__ // Sorry, some Motif-specific code to implement a backing pixmap