[Bf-blender-cvs] [c57636f0600] master: Fix failure in our UI code that could allow search button without search callbacks, leading to crash.

Bastien Montagne noreply at git.blender.org
Thu Sep 14 11:00:57 CEST 2017


Commit: c57636f06001880022a4a091d20615ba527f2389
Author: Bastien Montagne
Date:   Thu Sep 14 10:58:47 2017 +0200
Branches: master
https://developer.blender.org/rBc57636f06001880022a4a091d20615ba527f2389

Fix failure in our UI code that could allow search button without search callbacks, leading to crash.

Related to (exposed by) T52735, fixes the reported crash but not the
underlying issue.

To be backported to 2.79a should we do one.

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

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

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

diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index a95fe59348d..c21a76918e8 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -1726,6 +1726,10 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
 
 		UI_but_func_search_set(but, ui_searchbox_create_generic, rna_search_cb, but, NULL, NULL);
 	}
+	else if (but->type == UI_BTYPE_SEARCH_MENU) {
+		/* In case we fail to find proper searchprop, so other code might have already set but->type to search menu... */
+		but->type = UI_BTYPE_LABEL;
+	}
 }
 
 void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, struct PointerRNA *searchptr, const char *searchpropname, const char *name, int icon)



More information about the Bf-blender-cvs mailing list