diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-07-11 12:07:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-07-11 12:10:40 +0300 |
commit | d415a1cbd646b28f8b19da304b66dc580eb08763 (patch) | |
tree | a45d236cee261b216e67a703ced764d95b61837f /source/blender/editors/interface/interface_utils.c | |
parent | 218c254e72119603a82cf292c764c87702c528cf (diff) |
Fix T49034: multi-drag crashes when UI forces exit
Diffstat (limited to 'source/blender/editors/interface/interface_utils.c')
-rw-r--r-- | source/blender/editors/interface/interface_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 636b7e4e9ce..cf16cc9f50d 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -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); |