diff --git a/source/blender/makesrna/intern/rna_pose.cc b/source/blender/makesrna/intern/rna_pose.cc index 92eab7f3f21..d208667f440 100644 --- a/source/blender/makesrna/intern/rna_pose.cc +++ b/source/blender/makesrna/intern/rna_pose.cc @@ -651,6 +651,7 @@ void rna_Pose_custom_shape_set(PointerRNA *ptr, PointerRNA value, struct ReportL Object *custom_shape = static_cast(value.data); if (!custom_shape) { + id_us_min(reinterpret_cast(pchan->custom)); pchan->custom = nullptr; return; } @@ -663,7 +664,9 @@ void rna_Pose_custom_shape_set(PointerRNA *ptr, PointerRNA value, struct ReportL return; } + id_us_min(reinterpret_cast(pchan->custom)); pchan->custom = custom_shape; + id_us_plus(reinterpret_cast(pchan->custom)); } bool rna_Pose_custom_shape_object_poll(PointerRNA * /*ptr*/, PointerRNA value)