mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-12-19 09:27:48 -05:00
```
ui/UIStatic.cpp:113:15: runtime error: downcast of address 0x7b9f03ae6a00 which does not point to an object of type 'UIPrimativeItem'
0x7b9f03ae6a00: note: object is of type 'UITextItem'
00 00 00 00 d0 f9 57 02 00 00 00 00 ff be be be 00 ff 00 00 03 00 00 00 be be be be 70 64 dd 02
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'UITextItem'
[lines as per 51fb3fea609e81d3897c33d901dce0b7be68c082; ±1 line]
f0 UIStatic::SetTitle (this=0x7ccff4a8b200, item=0x7bfff384a030) at ui/UIStatic.cpp:113
f1 newuiSheet::UpdateChanges (this=0x7bfff3a8ee38) at Descent3/newui_core.cpp:1721
f2 newuiMenu::DoUI (this=0x7bfff3a8e4c0) at Descent3/newui_core.cpp:921
f3 OptionsMenu () at Descent3/config.cpp:1432
f4 MainMenu () at Descent3/menu.cpp:837
f5 MainLoop () at Descent3/descent.cpp:541
f6 Descent3 () at Descent3/descent.cpp:503
f7 oeD3LnxApp::run (this=0x7bfff3901050) at Descent3/sdlmain.cpp:142
f8 main (argc=1, argv=0x7fffffffdae8) at Descent3/sdlmain.cpp:322
```
In `SetTitle`, `CopyUIItem()` returns a `UIItem *` backed by the same class
that `item` is, which is not guaranteed to be a UIPrimativeItem object. That
guarantee only holds in the `SetBackground` function.
Fixes: df209742fc (bogus cast added)
Fixes: 51fb3fea60 (added UITextItem in the options dialog)