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:
authorBastien Montagne <bastien@blender.org>2022-10-05 16:54:03 +0300
committerBastien Montagne <bastien@blender.org>2022-10-05 16:59:25 +0300
commit6dd2e193e16fcae720b40d18e29c9e395b014833 (patch)
treef944b164bc61045011459696baac2b6d6befd239 /source/blender/makesrna/intern/rna_main_api.c
parentb47a234f98dd7e6e0b53ad96b5b4d278635874d8 (diff)
Fix T101405: Deleting a baked action results in an error.
RNA code to create new actions did not properly remove the extra user set by default, as done in other `new` callbacks of other ID types. NOTE: Mask ID had the same issue, also fixed in this commit. NOTE: At some point this needs to be properly fixed, default super-low level ID creation code should simply not add a 'default' user, this is extremely bad design and forces higher-level code to do all kind of extra work to get rid of it half of the time, in very unclear and confusing ways and places.
Diffstat (limited to 'source/blender/makesrna/intern/rna_main_api.c')
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 1f21fa3fab9..35678f2f1dd 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -629,6 +629,7 @@ static bAction *rna_Main_actions_new(Main *bmain, const char *name)
bAction *act = BKE_action_add(bmain, safe_name);
id_fake_user_clear(&act->id);
+ id_us_min(&act->id);
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
@@ -701,6 +702,7 @@ static Mask *rna_Main_mask_new(Main *bmain, const char *name)
rna_idname_validate(name, safe_name);
Mask *mask = BKE_mask_new(bmain, safe_name);
+ id_us_min(&mask->id);
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);