Changeset 15454 for trunk/psLib/src/mathtypes
- Timestamp:
- Nov 5, 2007, 1:42:46 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/mathtypes/psImage.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/mathtypes/psImage.c
r14921 r15454 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.13 0$ $Name: not supported by cvs2svn $12 * @date $Date: 2007- 09-20 23:48:30$11 * @version $Revision: 1.131 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-11-05 23:42:46 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 44 44 // if I am a child, remove me from my parent's array of children 45 45 if (parent != NULL) { 46 // sanity check : a child cannot also be a parent47 if ((image->children != NULL) && (image->children->n > 0)) {48 psAbort ("psImage cannot be both child and parent!");49 }50 51 // break the back-pointer first so we don't loop52 image->parent = NULL; 53 54 // drop my entry on my parent's array of children55 psArrayRemoveDataNoFree (parent->children, image); 56 57 // drop my reference to my parent58 psFree (parent);59 } 60 46 // sanity check : a child cannot also be a parent 47 if ((image->children != NULL) && (image->children->n > 0)) { 48 psAbort ("psImage cannot be both child and parent!"); 49 } 50 51 // break the back-pointer first so we don't loop 52 image->parent = NULL; 53 54 // drop my entry on my parent's array of children 55 psArrayRemoveDataNoFree (parent->children, image); 56 57 // drop my reference to my parent 58 psFree (parent); 59 } 60 61 61 // sanity check: this function should never be reached if an image still has live children; 62 62 // they should each be holding a pointer to the image, forcing the number of references to 63 63 // be > 1. 64 64 if (image->children && (image->children->n > 0)) { 65 psAbort ("psImage memory management programming error : imageFree called on image with live children");65 psAbort ("psImage memory management programming error : imageFree called on image with live children"); 66 66 } 67 67 … … 100 100 psMemSetDeallocator(image, (psFreeFunc) imageFree); 101 101 102 image->data.V = p sAlloc(sizeof(psPtr ) * numRows);103 104 image->p_rawDataBuffer = p sAlloc(numBytes);102 image->data.V = p_psAlloc(file, lineno, func, sizeof(psPtr ) * numRows); 103 104 image->p_rawDataBuffer = p_psAlloc(file, lineno, func, numBytes); 105 105 106 106 // set the row pointers.
Note:
See TracChangeset
for help on using the changeset viewer.
