diff options
author | Jacques Lucke <mail@jlucke.com> | 2019-05-16 15:11:11 +0300 |
---|---|---|
committer | Jacques Lucke <mail@jlucke.com> | 2019-05-16 15:11:11 +0300 |
commit | db5120603f8f6236d1417199f257e35e0eb8c00b (patch) | |
tree | b2c55dedaf2b49ac8abd4f50878bcf374e71cccb /source/blender/editors | |
parent | c0d743238d022e12872549176257db8b9d602e3d (diff) |
Refactor: Simplify ID Property freeing
This also makes `IDP_CopyProperty` the "opposite"
of `IDP_FreeProperty`, which is what I'd expect.
Two refactoring steps:
* rename IDP_FreeProperty to IDP_FreePropertyContent
* new IDP_FreeProperty function that actually frees the property
Reviewers: brecht
Differential Revision: https://developer.blender.org/D4872
Diffstat (limited to 'source/blender/editors')
7 files changed, 0 insertions, 11 deletions
diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 20dc7b6c826..27076f84c7f 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -127,7 +127,6 @@ void bone_free(bArmature *arm, EditBone *bone) if (bone->prop) { IDP_FreeProperty(bone->prop); - MEM_freeN(bone->prop); } /* Clear references from other edit bones. */ @@ -777,7 +776,6 @@ void ED_armature_edit_free(struct bArmature *arm) for (eBone = arm->edbo->first; eBone; eBone = eBone->next) { if (eBone->prop) { IDP_FreeProperty(eBone->prop); - MEM_freeN(eBone->prop); } } @@ -811,7 +809,6 @@ void ED_armature_ebone_listbase_free(ListBase *lb) if (ebone->prop) { IDP_FreeProperty(ebone->prop); - MEM_freeN(ebone->prop); } MEM_freeN(ebone); diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 7b31897766d..4bcfdc700b3 100644 --- a/source/blender/editors/armature/pose_lib.c +++ b/source/blender/editors/armature/pose_lib.c @@ -1018,7 +1018,6 @@ static void poselib_backup_free_data(tPoseLib_PreviewData *pld) /* free custom data */ if (plb->oldprops) { IDP_FreeProperty(plb->oldprops); - MEM_freeN(plb->oldprops); } /* free backup element now */ diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c index 49b66429515..ed728714c5b 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -1225,7 +1225,6 @@ static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op) for (pchan = dummyPose->chanbase.first; pchan; pchan = pchan->next) { if (pchan->prop) { IDP_FreeProperty(pchan->prop); - MEM_freeN(pchan->prop); } } diff --git a/source/blender/editors/armature/pose_utils.c b/source/blender/editors/armature/pose_utils.c index a1f763ac57d..fbaf2c896d0 100644 --- a/source/blender/editors/armature/pose_utils.c +++ b/source/blender/editors/armature/pose_utils.c @@ -203,7 +203,6 @@ void poseAnim_mapping_free(ListBase *pfLinks) /* free custom properties */ if (pfl->oldprops) { IDP_FreeProperty(pfl->oldprops); - MEM_freeN(pfl->oldprops); } /* free list of F-Curve reference links */ diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 340aa389f3f..0e4b07f4b48 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1086,7 +1086,6 @@ static bool ui_but_event_operator_string_from_menu(const bContext *C, } IDP_FreeProperty(prop_menu); - MEM_freeN(prop_menu); return found; } @@ -1135,7 +1134,6 @@ static bool ui_but_event_operator_string_from_panel(const bContext *C, } IDP_FreeProperty(prop_panel); - MEM_freeN(prop_panel); return found; } @@ -1356,7 +1354,6 @@ static bool ui_but_event_property_operator_string(const bContext *C, /* cleanup */ IDP_FreeProperty(prop_path); - MEM_freeN(prop_path); if (data_path) { MEM_freeN(data_path); } diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c index 0055349d4be..9ef98db49f5 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -116,7 +116,6 @@ static void shortcut_free_operator_property(IDProperty *prop) { if (prop) { IDP_FreeProperty(prop); - MEM_freeN(prop); } } diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 37ef0948dee..dc57be4f07f 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1455,7 +1455,6 @@ void uiItemsFullEnumO_items(uiLayout *layout, if (properties) { if (tptr.data) { IDP_FreeProperty(tptr.data); - MEM_freeN(tptr.data); } tptr.data = IDP_CopyProperty(properties); } |