diff options
author | Jacques Lucke <jacques@blender.org> | 2020-02-28 15:28:16 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-02-28 15:28:16 +0300 |
commit | c60be37f3ebf20ab9b4563d03c0acb97ecf047cc (patch) | |
tree | 9145e8306b7bcbd2b1869963464422fcf2b68e98 /source/blender/makesrna | |
parent | da1140f75e08ac5228474e5cdbb995ec7c0df579 (diff) |
Nodes: Use destructor callbacks for bNodeSocketType and bNodeType
Reviewers: brecht
Differential Revision: https://developer.blender.org/D6963
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index c4672ead29d..a0f7f9b585e 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -1652,8 +1652,7 @@ static bNodeType *rna_Node_register_base(Main *bmain, /* create a new node type */ nt = MEM_callocN(sizeof(bNodeType), "node type"); memcpy(nt, &dummynt, sizeof(dummynt)); - /* make sure the node type struct is freed on unregister */ - nt->needs_free = 1; + nt->free_self = (void (*)(bNodeType *))MEM_freeN; nt->ext.srna = RNA_def_struct_ptr(&BLENDER_RNA, nt->idname, basetype); nt->ext.data = data; @@ -2185,6 +2184,8 @@ static StructRNA *rna_NodeSocket_register(Main *UNUSED(bmain), nodeRegisterSocketType(st); } + st->free_self = (void (*)(bNodeSocketType * stype)) MEM_freeN; + /* if RNA type is already registered, unregister first */ if (st->ext_socket.srna) { StructRNA *srna = st->ext_socket.srna; @@ -2499,6 +2500,8 @@ static StructRNA *rna_NodeSocketInterface_register(Main *UNUSED(bmain), nodeRegisterSocketType(st); } + st->free_self = (void (*)(bNodeSocketType * stype)) MEM_freeN; + /* if RNA type is already registered, unregister first */ if (st->ext_interface.srna) { StructRNA *srna = st->ext_interface.srna; |