Index: trunk/psLib/src/types/psList.c
===================================================================
--- trunk/psLib/src/types/psList.c	(revision 18954)
+++ trunk/psLib/src/types/psList.c	(revision 18955)
@@ -7,6 +7,6 @@
  *  @author Joshua Hoblitt, University of Hawaii
  *
- *  @version $Revision: 1.70 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-07-31 23:41:04 $
+ *  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-08-08 18:06:27 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -457,15 +457,19 @@
 
 // simultaneous get and remove (ie, 'pop')
-psPtr psListGetAndRemove (psList *list, long location) {
+psPtr psListGetAndRemove(psList *list, long location) {
 
     PS_ASSERT_LIST_NON_NULL(list, NULL);
 
-    // empty list : 
+    // empty list :
     // XXX handle this explicitly since psListGet raises an error in this case
-    if (list->head == NULL) return NULL;
-
-    psPtr *item = psListGet (list, location);
-
-    psListRemove (list, location);
+    if (list->head == NULL) {
+        return NULL;
+    }
+
+    psPtr *item = psListGet (list, location); // Item of interest
+    if (psMemIncrRefCounter(item)) {    // To prevent psListRemove from killing the item before it gets out
+        psListRemove(list, location);
+    }
+
     return item;
 }
Index: trunk/psLib/src/types/psList.h
===================================================================
--- trunk/psLib/src/types/psList.h	(revision 18954)
+++ trunk/psLib/src/types/psList.h	(revision 18955)
@@ -5,6 +5,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-07-31 23:41:04 $
+ *  @version $Revision: 1.48 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-08-08 18:06:27 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -215,7 +215,7 @@
  *                      NULL is returned.
  */
-psPtr psListGetAndRemove (
-    psList *list, 			///< list from which to get and remove the element
-    long location			///< index of item
+psPtr psListGetAndRemove(
+    psList *list,                       ///< list from which to get and remove the element
+    long location                       ///< index of item
 );
 
