Default Game Speed

Log in to vote!

Currently Online

Latest Posts

Topic: How to use UI::Dropdown

Joined: 2017-01-17, 18:07
Posts: 523
One Elder of Players
Location: 0x55555d3a34c0
Posted at: 2019-12-03, 13:08

In two of my development branches, I am having trouble with UI::Dropdown.

In scenario-editor, I am adapting some WUI functionality for use in the editor. To set settings for productionsites there, the workers tab in ProductionSiteWindow gets a Dropdown. When opening the window in the editor, this works fine, but opening a TrainingsiteWindow (which inherits from ProductionSiteWindow) results in ASan crashing with heap-use-after-free.

In expedition-cfg, the port´s expedition tab gets a dropdown which works well. When the expedition is ready while the window is still open, the tab´s closing causes a heap-use-after-free.

In both cases, the backtrace points to

(many lines of boost::signals2::...)

Apparently, the dropdown hooks into all toplevel windows to layout properly, and the lambda function doesn´t seem to notice that the dropdown was already deleted if only a tab and not the whole window closes. Is this a bug in dropdown code, or is there some easy way to work around this?

Top Quote
Joined: 2018-07-30, 00:03
Posts: 273
Tribe Member
Location: Earth
Posted at: 2019-12-07, 12:50

I do have a problem myself with the Dropdowns. Dropdowns don't release focus. So, every time a Dropdown is opened, focus stays on this Dropdown even when closed or the window that contained the dropdown is closed the focus isn't regained by the map. This is quite annoying because this breaks scrolling, and the only way to get it back is to open a window that requests focus itself.

Top Quote