Changeset 5216 for trunk/psLib/src/imageops/psImageStructManip.c
- Timestamp:
- Sep 30, 2005, 4:22:26 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageStructManip.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageStructManip.c
r5057 r5216 8 8 * @author Robert DeSonia, MHPCC 9 9 * 10 * @version $Revision: 1. 5$ $Name: not supported by cvs2svn $11 * @date $Date: 2005- 09-15 21:22:22$10 * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $ 11 * @date $Date: 2005-10-01 02:22:11 $ 12 12 * 13 13 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 96 96 // if a child, need to orphan (disassociate from parent) first 97 97 if (out->parent != NULL) { 98 psArrayRemove(out->parent->children,out); // remove from parent's knowledge 98 psArrayRemove(out->parent->children,psMemIncrRefCounter(out)); 99 // remove from parent's knowledge without triggering a free 99 100 out->parent = NULL; // break link to parent 100 101 } … … 127 128 128 129 // add output image as a child of the input image. 129 psS32 n = 0; 130 psArray* children = image->children; 131 if (children == NULL) { 132 children = psArrayAlloc(16); // start with a reasonable size for growth 133 } else if (children->nalloc == children->n) { // full? 134 n = children->n; 135 children = psArrayRealloc(children,n*2); // double the array size 136 } else { 137 n = children->n; 138 } 139 children->data[n] = out; 140 children->n = n+1; 141 image->children = children; // push back any change (esp. if children==NULL before) 130 image->children = psArrayAdd(image->children,16,out); 131 psMemDecrRefCounter(out); // don't count the reference held by parent as a true reference 142 132 143 133 return (out);
Note:
See TracChangeset
for help on using the changeset viewer.
