diff options
-rw-r--r-- | release/scripts/startup/bl_operators/node.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index 4878b1c45ae..c8049189b5b 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -168,7 +168,10 @@ def node_items_iter(context): # Create an enum list from node class items def node_type_items_cb(self, context): - return [(str(index), item[1], item[2]) for index, item in enumerate(node_items_iter(context))] + # XXX Python has to keep a ref to those strings, else they may be freed :( + NODE_OT_add_search._enum_str_store = [(str(index), item[1], item[2]) + for index, item in enumerate(node_items_iter(context))] + return NODE_OT_add_search._enum_str_store class NODE_OT_add_search(NodeAddOperator, Operator): @@ -177,6 +180,9 @@ class NODE_OT_add_search(NodeAddOperator, Operator): bl_label = "Search and Add Node" bl_options = {'REGISTER', 'UNDO'} + # XXX Python has to keep a ref to the data (strings) generated by enum's callback, else they may be freed :( + _enum_str_store = [] + # XXX this should be called 'node_type' but the operator search # property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ... type = EnumProperty( |