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/windowmanager/intern | |
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/windowmanager/intern')
5 files changed, 0 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 7647e9f558f..77e17ad4687 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -82,7 +82,6 @@ void WM_operator_free(wmOperator *op) if (op->properties) { IDP_FreeProperty(op->properties); - MEM_freeN(op->properties); } if (op->reports && (op->reports->flag & RPT_FREE)) { diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 13b6260e2b9..8ad23af446d 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1293,7 +1293,6 @@ static bool operator_last_properties_init_impl(wmOperator *op, IDProperty *last_ IDP_MergeGroup(op->properties, replaceprops, true); IDP_FreeProperty(replaceprops); - MEM_freeN(replaceprops); return changed; } @@ -1316,7 +1315,6 @@ bool WM_operator_last_properties_store(wmOperator *op) { if (op->type->last_properties) { IDP_FreeProperty(op->type->last_properties); - MEM_freeN(op->type->last_properties); op->type->last_properties = NULL; } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 4bcbce028b1..a4ee735d911 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -1412,7 +1412,6 @@ static wmKeyMapItem *wm_keymap_item_find_in_keymap(wmKeyMap *keymap, } IDP_FreeProperty(properties_default); - MEM_freeN(properties_default); } } } @@ -1586,7 +1585,6 @@ static wmKeyMapItem *wm_keymap_item_find(const bContext *C, } IDP_FreeProperty(properties_temp); - MEM_freeN(properties_temp); } } @@ -1625,7 +1623,6 @@ static wmKeyMapItem *wm_keymap_item_find(const bContext *C, } IDP_FreeProperty(properties_default); - MEM_freeN(properties_default); } } } @@ -2022,7 +2019,6 @@ void WM_keymap_item_restore_to_default(bContext *C, wmKeyMap *keymap, wmKeyMapIt if (orig->properties) { if (kmi->properties) { IDP_FreeProperty(kmi->properties); - MEM_freeN(kmi->properties); kmi->properties = NULL; } diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c index 3585cffc615..179b4402200 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.c +++ b/source/blender/windowmanager/intern/wm_operator_type.c @@ -156,7 +156,6 @@ void WM_operatortype_remove_ptr(wmOperatorType *ot) if (ot->last_properties) { IDP_FreeProperty(ot->last_properties); - MEM_freeN(ot->last_properties); } if (ot->macro.first) { @@ -194,7 +193,6 @@ static void operatortype_ghash_free_cb(wmOperatorType *ot) { if (ot->last_properties) { IDP_FreeProperty(ot->last_properties); - MEM_freeN(ot->last_properties); } if (ot->macro.first) { @@ -279,7 +277,6 @@ void WM_operatortype_last_properties_clear_all(void) if (ot->last_properties) { IDP_FreeProperty(ot->last_properties); - MEM_freeN(ot->last_properties); ot->last_properties = NULL; } } diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 8445f27ceba..0bb2fd58824 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -691,7 +691,6 @@ void WM_operator_properties_free(PointerRNA *ptr) if (properties) { IDP_FreeProperty(properties); - MEM_freeN(properties); ptr->data = NULL; /* just in case */ } } |