DarkRadiant: master 67744794

Author Committer Branch Timestamp Parent
orbweaver orbweaver master 14.08.2024 19:07 master 182de453
Affected Issues  0006562: wxGTK assertion on opening Stim/Response Editor
Changeset 0006562: fix for wxGTK assertion on opening Stim/Response editor

Remove the GTK-specific workaround in TreeModel::Clear() and replace it
with a far simpler approach: instead of deleting or clearing out the
root node, it is std::swapped with an empty replacement, which keeps the
old tree allocated until the end of the function.

This means that Cleared() still sees an empty root node, but the
internal wxDataViewItem pointers will not point to deallocated memory if
the wxGTK back-end chooses to dereference them during the Cleared()
call.

So far this seems to fix the S/R editor assertion without re-introducing
the crashes that the GTK-specific workaround was intended to fix, but
we'll have to wait and see if it works correctly on all the various
wxGTK versions (including FlatPak).
mod - libs/wxutil/dataview/TreeModel.cpp Diff File