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-02-25 13:40:19 +0300
committerBastien Montagne <bastien@blender.org>2022-02-25 13:40:19 +0300
commit8ddeb71a551325b40f204765d14462bc9fc5947a (patch)
tree48f4d737325be461699d05a3f712a96c296d75c1 /source/blender/windowmanager/intern/wm_dragdrop.c
parent4c9846eeae03c8224d9d5dd9d26cdcf9a43da252 (diff)
parent66328db703bba8196f159d15d9632c34d845892d (diff)
Merge branch 'blender-v3.1-release'
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index f69a612df19..685d74f6d20 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -651,8 +651,12 @@ void WM_drag_free_imported_drag_ID(struct Main *bmain, wmDrag *drag, wmDropBox *
}
ID *id = BKE_libblock_find_name(bmain, asset_drag->id_type, name);
- if (id) {
- BKE_id_delete(bmain, id);
+ if (id != NULL) {
+ /* Do not delete the dragged ID if it has any user, otherwise if it is a 're-used' ID it will
+ * cause T95636. Note that we need first to add the user that we want to remove in
+ * #BKE_id_free_us. */
+ id_us_plus(id);
+ BKE_id_free_us(bmain, id);
}
}