Fix T49034: multi-drag crashes when UI forces exit
This commit is contained in:
parent
218c254e72
commit
d415a1cbd6
Notes:
blender-bot
2023-02-14 07:42:07 +01:00
Referenced by issue #49034, Crash when trying to adjust Frame in Graph Editor
|
@ -380,6 +380,17 @@ uiButStore *UI_butstore_create(uiBlock *block)
|
|||
|
||||
void UI_butstore_free(uiBlock *block, uiButStore *bs_handle)
|
||||
{
|
||||
/* Workaround for button store being moved into new block,
|
||||
* which then can't use the previous buttons state ('ui_but_update_from_old_block' fails to find a match),
|
||||
* keeping the active button in the old block holding a reference to the button-state in the new block: see T49034.
|
||||
*
|
||||
* Ideally we would manage moving the 'uiButStore', keeping a correct state.
|
||||
* All things considered this is the most straightforward fix - Campbell.
|
||||
*/
|
||||
if (block != bs_handle->block && bs_handle->block != NULL) {
|
||||
block = bs_handle->block;
|
||||
}
|
||||
|
||||
BLI_freelistN(&bs_handle->items);
|
||||
BLI_remlink(&block->butstore, bs_handle);
|
||||
|
||||
|
|
Loading…
Reference in New Issue