UI Code Quality: Clear layout pointer on layout destruction
The layout pointer is quite ugly, but currently needed to work around design issues. At least it should be cleared to avoid use-after-free.
This commit is contained in:
parent
825a32439a
commit
f7655dd322
|
@ -5586,6 +5586,9 @@ static void ui_layout_free(uiLayout *layout)
|
|||
{
|
||||
LISTBASE_FOREACH_MUTABLE (uiItem *, item, &layout->items) {
|
||||
if (item->type == ITEM_BUTTON) {
|
||||
uiButtonItem *bitem = (uiButtonItem *)item;
|
||||
|
||||
bitem->but->layout = NULL;
|
||||
MEM_freeN(item);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue