Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 255d6f19789..3638403660d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -461,14 +461,10 @@ static void wm_operatortype_free_macro(wmOperatorType *ot)
BLI_freelistN(&ot->macro);
}
-
-int WM_operatortype_remove(const char *idname)
+void WM_operatortype_remove_ptr(wmOperatorType *ot)
{
- wmOperatorType *ot = WM_operatortype_find(idname, 0);
+ BLI_assert(ot == WM_operatortype_find(ot->idname, false));
- if (ot == NULL)
- return 0;
-
RNA_struct_free(&BLENDER_RNA, ot->srna);
if (ot->last_properties) {
@@ -482,7 +478,18 @@ int WM_operatortype_remove(const char *idname)
BLI_ghash_remove(global_ops_hash, (void *)ot->idname, NULL, NULL);
MEM_freeN(ot);
- return 1;
+}
+
+bool WM_operatortype_remove(const char *idname)
+{
+ wmOperatorType *ot = WM_operatortype_find(idname, 0);
+
+ if (ot == NULL)
+ return false;
+
+ WM_operatortype_remove_ptr(ot);
+
+ return true;
}
/* SOME_OT_op -> some.op */