[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60784] trunk/blender/source/blender/ editors/object/object_relations.c: Fix #37090: Blender crashes on " Make single user" option

Sergey Sharybin sergey.vfx at gmail.com
Tue Oct 15 19:11:16 CEST 2013


Revision: 60784
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60784
Author:   nazgul
Date:     2013-10-15 17:11:15 +0000 (Tue, 15 Oct 2013)
Log Message:
-----------
Fix #37090: Blender crashes on "Make single user" option

issue was caused by id->mewid pointing to an invalid memory
after file load.

The rule here: all the tools need to reset it to NULL (or
other value they need) in the beginning.

Currently some tools are doing newid clear in the beginning
and some does it in the end. We need to clean it up so clear
only happens in the beginning.

But ideal we need some kind NewIDContext to make duplication
safe for threading.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_relations.c

Modified: trunk/blender/source/blender/editors/object/object_relations.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_relations.c	2013-10-15 15:56:00 UTC (rev 60783)
+++ trunk/blender/source/blender/editors/object/object_relations.c	2013-10-15 17:11:15 UTC (rev 60784)
@@ -2211,6 +2211,8 @@
 	int flag = RNA_enum_get(op->ptr, "type"); /* 0==ALL, SELECTED==selected objecs */
 	bool copy_groups = false;
 
+	clear_id_newpoins();
+
 	if (RNA_boolean_get(op->ptr, "object"))
 		single_object_users(bmain, scene, v3d, flag, copy_groups);
 
@@ -2227,6 +2229,11 @@
 	if (RNA_boolean_get(op->ptr, "animation"))
 		single_object_action_users(scene, flag);
 
+	/* TODO(sergey): This should not be needed, however some tool still could rely
+	 *               on the fact, that id->newid is kept NULL by default.
+	 *               Need to make sure all the guys are learing newid before they're
+	 *               using it, not after.
+	 */
 	clear_id_newpoins();
 
 	WM_event_add_notifier(C, NC_WINDOW, NULL);




More information about the Bf-blender-cvs mailing list