Open brianwatling opened 3 months ago
Saw some of that with the cvector reallocs. https://github.com/RobLoach/nuklear_console/pull/73 may help some. Definitely need a way to defer the destruction of the keyboard. Or maybe just not destroy the keyboard at all.
nk_console_textedit_button_back_click
callsnk_console_free_children
on button->parent which by definition frees the button itself. When this is invokednk_console_button_render
then proceeds to do postprocessing for disabled and up/down/tooltip on the deleted button and triggers a use after free crash. Instead the button should queue itself to be deleted in another phase or some other solution should be found.I first noticed the crash in a debug build of my own project - I use mimalloc which can detect some use-after-free bugs in debug mode. Running the demo with ASAN confirmed the root cause and gave the (trimmed) trace below.