[Bf-blender-cvs] [d415a1cbd64] master: Fix T49034: multi-drag crashes when UI forces exit

Campbell Barton noreply at git.blender.org
Tue Jul 11 11:00:52 CEST 2017


Commit: d415a1cbd646b28f8b19da304b66dc580eb08763
Author: Campbell Barton
Date:   Tue Jul 11 19:07:37 2017 +1000
Branches: master
https://developer.blender.org/rBd415a1cbd646b28f8b19da304b66dc580eb08763

Fix T49034: multi-drag crashes when UI forces exit

===================================================================

M	source/blender/editors/interface/interface_utils.c

===================================================================

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);




More information about the Bf-blender-cvs mailing list