VMS piping ... cleanup at interpreter exit
Charles Lane [Thu, 1 Mar 2001 15:54:09 +0000 (10:54 -0500)]
Message-Id: <010301155258.b8cc1@DUPHY4.Physics.Drexel.Edu>

p4raw-id: //depot/perl@8983

vms/vms.c

index 43a5c22..7915679 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -1732,6 +1732,18 @@ struct _pipeloc {
 };
 static pPLOC  head_PLOC = 0;
 
+void
+free_pipelocs(void *head)
+{
+    pPLOC p, pnext;
+
+    p = (pPLOC) head;
+    while (p) {
+        pnext = p->next;
+        Safefree(p);
+        p = pnext;
+    }
+}
 
 static void
 store_pipelocs()
@@ -1798,7 +1810,7 @@ store_pipelocs()
         p->dir[NAM$C_MAXRSS] = '\0';
     }
 #endif
-
+    Perl_call_atexit(&free_pipelocs, head_PLOC);
 }