Posted at: 2019-12-03, 13:08
In two of my development branches, I am having trouble with UI::Dropdown.
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.
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?