# HG changeset patch # User truelight # Date 1194784004 0 # Node ID e82c1fca64eec810d8a81356e712d22b022bce60 # Parent 8232d650df929abf17d24520cda0aea1d6bd2918 (svn r11405) -Fix: in rare cases OpenTTD could segfault when resizing and scroll the main window (Rafal Rzepecki) diff -r 8232d650df92 -r e82c1fca64ee src/window.cpp --- a/src/window.cpp Sun Nov 11 01:39:15 2007 +0000 +++ b/src/window.cpp Sun Nov 11 12:26:44 2007 +0000 @@ -1466,6 +1466,12 @@ w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); + if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) { + _cursor.fix_at = false; + _scrolling_viewport = false; + return true; + } + if (WP(w, vp_d).follow_vehicle != INVALID_VEHICLE && w == FindWindowById(WC_MAIN_WINDOW, 0)) { /* If the main window is following a vehicle, then first let go of it! */ const Vehicle *veh = GetVehicle(WP(w, vp_d).follow_vehicle); @@ -1473,12 +1479,6 @@ return true; } - if (!(_right_button_down || scrollwheel_scrolling) || w == NULL) { - _cursor.fix_at = false; - _scrolling_viewport = false; - return true; - } - if (_patches.reverse_scroll) { e.we.scroll.delta.x = -_cursor.delta.x; e.we.scroll.delta.y = -_cursor.delta.y;