Revision: 16946
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16946
Author:   joeedh
Date:     2008-10-06 12:24:32 +0200 (Mon, 06 Oct 2008)

Log Message:
-----------
one-liner fix for id property duplication bug

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/idprop.c

Modified: trunk/blender/source/blender/blenkernel/intern/idprop.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/idprop.c     2008-10-06 
09:17:49 UTC (rev 16945)
+++ trunk/blender/source/blender/blenkernel/intern/idprop.c     2008-10-06 
10:24:32 UTC (rev 16946)
@@ -220,6 +220,10 @@
        return newp;
 }
 
+/*
+ replaces a property with the same name in a group, or adds 
+ it if the propery doesn't exist.
+*/
 void IDP_ReplaceInGroup(IDProperty *group, IDProperty *prop)
 {
        IDProperty *loop;
@@ -230,8 +234,7 @@
                        
                        BLI_remlink(&group->data.group, loop);
                        IDP_FreeProperty(loop);
-                       MEM_freeN(loop);
-                       
+                       MEM_freeN(loop);                        
                        return;
                }
        }
@@ -263,7 +266,7 @@
        }
        
        group->len++;
-       
+
        BLI_insertlink(&group->data.group, previous, pnew);
        return 1;
 }
@@ -349,6 +352,7 @@
                if (create_if_needed) {
                        id->properties = MEM_callocN(sizeof(IDProperty), 
"IDProperty");
                        id->properties->type = IDP_GROUP;
+                       strcpy(id->name, "top_level_group");
                }
                return id->properties;
        }
@@ -424,7 +428,7 @@
        return prop;
 }
 
-/*NOTE: this will free all child properties of list arrays and groups!
+/*NOTE: this will free all child properties including list arrays and groups!
   Also, note that this does NOT unlink anything!  Plus it doesn't free
   the actual IDProperty struct either.*/
 void IDP_FreeProperty(IDProperty *prop)
@@ -442,7 +446,8 @@
        }
 }
 
-/*Unlinks any IDProperty<->ID linkage that might be going on.*/
+/*Unlinks any IDProperty<->ID linkage that might be going on.
+  note: currently unused.*/
 void IDP_UnlinkProperty(IDProperty *prop)
 {
        switch (prop->type) {


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to