Index: /trunk/psLib/psLib.kdevses
===================================================================
--- /trunk/psLib/psLib.kdevses	(revision 2702)
+++ /trunk/psLib/psLib.kdevses	(revision 2703)
@@ -3,9 +3,9 @@
 <KDevPrjSession>
  <DocsAndViews NumberOfDocuments="2" >
-  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/test/astronomy/tst_psMetadataIO.c" >
-   <View0 line="49" Type="Source" />
+  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psList.c" >
+   <View0 line="39" Type="Source" />
   </Doc0>
-  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/test/astronomy/tst_psMetadata_01.c" >
-   <View0 line="76" Type="Source" />
+  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psList.h" >
+   <View0 line="0" Type="Source" />
   </Doc1>
  </DocsAndViews>
Index: /trunk/psLib/src/sys/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sys/psErrorCodes.c	(revision 2702)
+++ /trunk/psLib/src/sys/psErrorCodes.c	(revision 2703)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-10 02:50:15 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-13 20:49:56 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -79,7 +79,9 @@
         while ((desc = (psErrorDescription*)psListGetNext(iter)) != NULL) {
             if (desc->code == code) {
+                psFree(iter);
                 return desc;
             }
         }
+        psFree(iter);
     }
     return NULL;
@@ -140,4 +142,10 @@
         dynamicErrorCodes = psListAlloc(NULL);
         p_psMemSetPersistent(dynamicErrorCodes,true);
+
+        p_psMemSetPersistent(dynamicErrorCodes->iterators,true);
+        p_psMemSetPersistent(dynamicErrorCodes->iterators->data,true);
+        for (int i = 0; i < dynamicErrorCodes->iterators->n;i++) {
+            p_psMemSetPersistent(dynamicErrorCodes->iterators->data[i],true);
+        }
     }
 
Index: /trunk/psLib/src/sys/psMemory.c
===================================================================
--- /trunk/psLib/src/sys/psMemory.c	(revision 2702)
+++ /trunk/psLib/src/sys/psMemory.c	(revision 2703)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-12-01 00:56:32 $
+*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-12-13 20:49:56 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -431,10 +431,13 @@
         psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
 
-        psError(PS_ERR_MEMORY_DEREF_USAGE,true,
-                PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
+        psAbort(__func__,PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
                 ptr->id, ptr->file, ptr->lineno, file, lineno);
-
-        return;
-    }
+    }
+
+    if (checkMemBlock(ptr, __func__) != 0) {
+        memProblemCallback(ptr, file, lineno);
+        psAbort(__func__,"Memory Corruption Detected.");
+    }
+
     (void)p_psMemDecrRefCounter(vptr, file, lineno);    // this handles the free, if required.
 }
Index: /trunk/psLib/src/sysUtils/psErrorCodes.c
===================================================================
--- /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 2702)
+++ /trunk/psLib/src/sysUtils/psErrorCodes.c	(revision 2703)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-10 02:50:15 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-13 20:49:56 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -79,7 +79,9 @@
         while ((desc = (psErrorDescription*)psListGetNext(iter)) != NULL) {
             if (desc->code == code) {
+                psFree(iter);
                 return desc;
             }
         }
+        psFree(iter);
     }
     return NULL;
@@ -140,4 +142,10 @@
         dynamicErrorCodes = psListAlloc(NULL);
         p_psMemSetPersistent(dynamicErrorCodes,true);
+
+        p_psMemSetPersistent(dynamicErrorCodes->iterators,true);
+        p_psMemSetPersistent(dynamicErrorCodes->iterators->data,true);
+        for (int i = 0; i < dynamicErrorCodes->iterators->n;i++) {
+            p_psMemSetPersistent(dynamicErrorCodes->iterators->data[i],true);
+        }
     }
 
Index: /trunk/psLib/src/sysUtils/psMemory.c
===================================================================
--- /trunk/psLib/src/sysUtils/psMemory.c	(revision 2702)
+++ /trunk/psLib/src/sysUtils/psMemory.c	(revision 2703)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.46 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-12-01 00:56:32 $
+*  @version $Revision: 1.47 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-12-13 20:49:56 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -431,10 +431,13 @@
         psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
 
-        psError(PS_ERR_MEMORY_DEREF_USAGE,true,
-                PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
+        psAbort(__func__,PS_ERRORTEXT_psMemory_MULTIPLE_FREE,
                 ptr->id, ptr->file, ptr->lineno, file, lineno);
-
-        return;
-    }
+    }
+
+    if (checkMemBlock(ptr, __func__) != 0) {
+        memProblemCallback(ptr, file, lineno);
+        psAbort(__func__,"Memory Corruption Detected.");
+    }
+
     (void)p_psMemDecrRefCounter(vptr, file, lineno);    // this handles the free, if required.
 }
Index: /trunk/psLib/test/sysUtils/tst_psMemory.c
===================================================================
--- /trunk/psLib/test/sysUtils/tst_psMemory.c	(revision 2702)
+++ /trunk/psLib/test/sysUtils/tst_psMemory.c	(revision 2703)
@@ -6,6 +6,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-12-01 00:55:34 $
+*  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-12-13 20:49:56 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -46,40 +46,18 @@
 
 testDescription tests[] = {
-                              {
-                                  TPCheckBufferPositive, 449, "checkBufferPositive", 0, false
-                              },
-                              {
-                                  TPOutOfMemory, 450, "outOfMemory", -6, false
-                              },
-                              {
-                                  TPReallocOutOfMemory, 562, "reallocOutOfMemory", -6, false
-                              },
-                              {
-                                  TPrealloc, 451, "psRealloc", 0, false
-                              },
-                              {
-                                  TPallocCallback, 452, "allocCallback", 0, false
-                              },
-                              {
-                                  TPallocCallback, 453, "allocCallback2", 0, true
-                              },
-                              {
-                                  TPcheckLeaks, 454, "checkLeaks", 0, false
-                              },
-                              {
-                                  TPmemCorruption, 455, "psMemCorruption", 0, false
-                              },
-                              {
-                                  TPFreeReferencedMemory, 456, "freeReferencedMemory", 0, false
-                              },
-                              {
-                                  TPmultipleFree, 699, "multipleFree", 0, false
-                              },
-                              {
-                                  NULL
-                              }
+                              {TPCheckBufferPositive, 449, "checkBufferPositive", 0, false},
+                              {TPOutOfMemory, 450, "outOfMemory", -6, false},
+                              {TPReallocOutOfMemory, 562, "reallocOutOfMemory", -6, false},
+                              {TPrealloc, 451, "psRealloc", 0, false},
+                              {TPallocCallback, 452, "allocCallback", 0, false},
+                              {TPallocCallback, 453, "allocCallback2", 0, true},
+                              {TPcheckLeaks, 454, "checkLeaks", 0, false},
+                              {TPmemCorruption, 455, "psMemCorruption", 0, false},
+                              {TPFreeReferencedMemory, 456, "freeReferencedMemory", 0, false},
+                              {TPmultipleFree, 699, "multipleFree", -6, false},
+                              {NULL}
                           };
 
-psS32 main( psS32 argc, char* argv[] )
+psS32 main(psS32 argc, char* argv[])
 {
     psLogSetLevel( PS_LOG_INFO );
@@ -550,19 +528,10 @@
     psFree( buffer );
 
-    psLogMsg( __func__, PS_LOG_INFO, "Next should be an error about multiple freeing." );
+    psLogMsg( __func__, PS_LOG_INFO, "Next should abort due to multiple freeing." );
     psFree( buffer );
 
-    psErr* err = (psErr*)psErrorLast();
-
-    if (err->code != PS_ERR_MEMORY_DEREF_USAGE) {
-        psError(PS_ERR_UNKNOWN,true,
-                "Multiple psFree calls generated wrong error code (%d)",
-                err->code);
-        psFree(err);
-        return 1;
-    }
-
-    psFree(err);
-
-    return 0;
-}
+    psError(PS_ERR_UNKNOWN,true,
+            "Multiple psFree call survived");
+
+    return 0;
+}
Index: /trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr
===================================================================
--- /trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr	(revision 2702)
+++ /trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr	(revision 2703)
@@ -145,6 +145,6 @@
 
 <DATE><TIME>|<HOST>|I|TPmultipleFree
-    Next should be an error about multiple freeing.
-<DATE><TIME>|<HOST>|E|p_psFree (psMemory.c:<LINENO>)
+    Next should abort due to multiple freeing.
+<DATE><TIME>|<HOST>|A|p_psFree
     Block 1, allocated at tst_psMemory.c:<LINENO>, freed multiple times at tst_psMemory.c:<LINENO>.
 
