FS#6453 - Crash: scrolling down list of (none) GS parameters

Attached to Project: OpenTTD
Opened by Ricardo (Samu) - Monday, 25 April 2016, 16:47 GMT
Last edited by andythenorth (andythenorth) - Friday, 25 August 2017, 10:22 GMT
Type Bug
Category Interface
Status With patch
Assigned To No-one
Operating System Windows
Severity Medium
Priority Urgent
Reported Version 1.6.0
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No


To reproduce this bug, I used GS Villages Is Villages v2 which contains many parameter items in its configuration, forcing a vertical scrollbar to be active.


- launch OpenTTD
- click AI/Game Script Settings
- click GS slot, click Select Game Script and select Villages is Villages, click Accept.
- click Configure and let this window open.
- click Select Game Script and select (none), click Accept.

 bug 1 : Configure window didn't close.
 bug 2 : Vertical scrollbar is still reflecting the amount of parameter items of Villages Is Villages

- click on the scrollbar to scroll down...
... OpenTTD crashes.
This task depends upon

Comment by Ricardo (Samu) - Tuesday, 26 April 2016, 15:44 GMT
Uploading another crash that can occur due to the Configure window not closing. This time it was a mix of two AIs and a dropdown list. It's difficult to trigger this crash. Sometimes when selecting a label from the dropdown crashes, sometimes it doesn't. Steps are quite similar.


- launch OpenTTD
- click AI/Game Script Settings
- click an AI slot, click Select AI, select an AI which you know it contains a dropdown parameter
- click Configure, expand the dropdown list, and let this window open without chosing a value from the dropdown list
- click Select AI and select another AI, click Accept.

 bug 1 : Configure window didn't close.
 bug 2 : Dropdown list is still reflecting the values from the previous AI

- click on a value from the dropdown list...
... OpenTTD may or may not crash.
Comment by Ricardo (Samu) - Tuesday, 26 April 2016, 15:53 GMT
Mixed up parameters of Chopper and AdmiralAI when I last switched to Random AI.
Comment by Ricardo (Samu) - Saturday, 30 April 2016, 17:02 GMT
Just found out that it can also crash for View readme, Changelog and License windows in a very similar fashion. They didn't close when Selecting another AI or GS and clicking Accept.
Comment by Ricardo (Samu) - Wednesday, 04 May 2016, 17:17 GMT
This is a crash report for NewGRF Settings window, which is similar in nature.


- launch OpenTTD
- click NewGRF Settings
- have 1 active NewGRF file
- click License button
- without closing the License window, remove the active NewGRF file...

... OpenTTD crash.

Comment by 3298 (3298) - Friday, 25 August 2017, 10:21 GMT
Attaching a simple patch that prevents the issues that eventually lead to the crashes. It closes the parameters window and the textfile window more aggressively. The new behavior is also consistent with other settings windows: one or the other can be open - the parameters and textfile close when the list is opened.