Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-05 11:13:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-05 11:13:23 +0400
commit2b90eb18e2dc4338263f3a1d90b04a6354a1815b (patch)
treecdf865f6962966f87dae3cff8eba68d5c5e8fccb /source/blender/editors/interface
parentdcb26e4e47bf781a8d7953cca4979d9ab5c41af0 (diff)
Commit r33378 adds a red alert to search buttons which have items which are not in the list.
Disable this for pointer buttons since this was intended for vgroups & uvlayers. Pointer buttons often reference ID's which can be in the 1000+, lookups like this on each button draw is not useful since invalid pointers here will likely crash on scene evaluation.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_regions.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 4a0584bca7b..22d91a7a747 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -1091,9 +1091,17 @@ void ui_searchbox_free(bContext *C, ARegion *ar)
/* XXX weak: search_func adds all partial matches... */
void ui_but_search_test(uiBut *but)
{
- uiSearchItems *items= MEM_callocN(sizeof(uiSearchItems), "search items");
+ uiSearchItems *items;
int x1;
-
+
+ /* possibly very large lists (such as ID datablocks) only
+ * only validate string RNA buts (not pointers) */
+ if(but->rnaprop && RNA_property_type(but->rnaprop) != PROP_STRING) {
+ return;
+ }
+
+ items= MEM_callocN(sizeof(uiSearchItems), "search items");
+
/* setup search struct */
items->maxitem= 10;
items->maxstrlen= 256;