fix for crash showing tooltip for NODE_OT_add_search()
authorCampbell Barton <ideasman42@gmail.com>
Fri, 17 Aug 2012 11:31:54 +0000 (11:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 17 Aug 2012 11:31:54 +0000 (11:31 +0000)
release/scripts/startup/bl_operators/node.py
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_regions.c

index 8a6874b43d1188d4818f1bf81f9e6e2899ca1aaa..a15688200b06d2a1bc29b5a3cf7893be76115dcc 100644 (file)
@@ -57,10 +57,10 @@ def node_group_items(tree_type):
 def node_type_items_cb(self, context):
     snode = context.space_data
     if not snode:
-        return []
+        return ()
     tree = snode.edit_tree
     if not tree:
-        return []
+        return ()
 
     # Lists of basic node types for each
     if not node_type_items_dict:
@@ -76,7 +76,7 @@ def node_type_items_cb(self, context):
     if tree.type in node_type_items_dict:
         return node_type_items_dict[tree.type] + node_group_items(tree.type)
     else:
-        return []
+        return ()
 
 
 class NODE_OT_add_search(Operator):
index c6787b4c55459cd9b1a32b5bbdf6e87593850d23..95049857d49311a8fd6ae1b1474a19e232df3fb6 100644 (file)
@@ -176,7 +176,7 @@ struct uiBut {
 
        struct bContextStore *context;
 
-       /* not ysed yet, was used in 2.4x for ui_draw_pulldown_round & friends */
+       /* not used yet, was used in 2.4x for ui_draw_pulldown_round & friends */
 #if 0
        void (*embossfunc)(int, int, float, float, float, float, float, int);
        void (*sliderfunc)(int, float, float, float, float, float, float, int);
index 70f2bf7b02812e5e47db69f2ea61df29d39dda23..ce4043eea6a95d9e09d7102935dfdf331632b018 100644 (file)
@@ -573,6 +573,9 @@ ARegion *ui_tooltip_create(bContext *C, ARegion *butregion, uiBut *but)
                char *str;
                opptr = uiButGetOperatorPtrRNA(but); /* allocated when needed, the button owns it */
 
+               /* so the context is passed to itemf functions (some py itemf functions use it) */
+               WM_operator_properties_sanitize(opptr, FALSE);
+
                str = WM_operator_pystring(C, but->optype, opptr, 0);
 
                /* operator info */