Bugfix [#26002] Outliner Visible layers + Single object & data = broke

conections

It seems that some of the Outliner hacks used while building the tree
was causing problems, as Make Single User (and potentially other code
working with ID-data, specifically with the "newid" value there) was
making use of the variable used there for other purposes, leading to
memory corruption.

This bug also occurred in 2.4x, though when I tested there, it crashed
immediately.

Ton, you may want to double-check this bug!
This commit is contained in:
Joshua Leung
2011-02-10 10:14:12 +00:00
parent fc3b29b637
commit 5dffb64675

View File

@@ -1377,6 +1377,11 @@ void single_object_users(Scene *scene, View3D *v3d, int flag)
for(base= FIRSTBASE; base; base= base->next) {
ob= base->object;
/* newid may still have some trash from Outliner tree building,
* so clear that first to avoid errors [#26002]
*/
ob->id.newid = NULL;
if( (base->flag & flag)==flag ) {
if(ob->id.lib==NULL && ob->id.us>1) {
/* base gets copy of object */