Index: /trunk/psLib/src/types/psArray.c
===================================================================
--- /trunk/psLib/src/types/psArray.c	(revision 14926)
+++ /trunk/psLib/src/types/psArray.c	(revision 14927)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-03-07 02:50:15 $
+ *  @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-20 23:56:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -163,4 +163,5 @@
 }
 
+// drop an item from the array and free it
 bool psArrayRemoveData(psArray* array,
                        const psPtr data)
@@ -185,4 +186,28 @@
 }
 
+// drop an item from the array and do not free it: this 
+// can be useful in the free function of a data type
+// with a reference on another structure
+bool psArrayRemoveDataNoFree(psArray* array,
+			     const psPtr data)
+{
+    PS_ASSERT_ARRAY_NON_NULL(array, false);
+    PS_ASSERT_PTR_NON_NULL(data, false);
+
+    bool success = false;
+    long n = array->n;
+    psPtr *arrayData = array->data;
+    for (long i = n-1; i >= 0; i--) {
+        if (arrayData[i] == data) {
+            memmove(&arrayData[i],&arrayData[i+1],(n-i-1)*sizeof(psPtr));
+            n--;
+            success = true;
+        }
+    }
+    array->n = n; // reset the array size to indicate the removed item(s)
+
+    return success;
+}
+
 bool psArrayRemoveIndex(psArray* array,
                         long index)
Index: /trunk/psLib/src/types/psArray.h
===================================================================
--- /trunk/psLib/src/types/psArray.h	(revision 14926)
+++ /trunk/psLib/src/types/psArray.h	(revision 14927)
@@ -10,6 +10,6 @@
  *  @author Joshua Hoblitt, University of Hawaii
  *
- *  @version $Revision: 1.49 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-08-09 01:40:08 $
+ *  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-09-20 23:56:57 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -161,4 +161,18 @@
 
 
+/** Remove an element from the array by it's pointer WITHOUT freeing
+ *
+ *  Finds and removes the specified data pointer from the list, but does not free it
+ *
+ * @return bool:  TRUE if the specified data pointer was found and removed,
+ *                otherwise FALSE.
+ *
+ */
+bool psArrayRemoveDataNoFree(
+    psArray* array,                    ///< array to operate on
+    const psPtr data                   ///< the data pointer to remove from psArray
+);
+
+
 /** Remove an element from the array
  *
