[svn:parrot] r40028 - branches/io_cleanups/src/pmc

Infinoid at svn.parrot.org Infinoid at svn.parrot.org
Sun Jul 12 22:10:11 UTC 2009


Author: Infinoid
Date: Sun Jul 12 22:10:06 2009
New Revision: 40028
URL: https://trac.parrot.org/parrot/changeset/40028

Log:
Pipe needs a destroy function to free its attr structure.

Modified:
   branches/io_cleanups/src/pmc/pipe.pmc

Modified: branches/io_cleanups/src/pmc/pipe.pmc
==============================================================================
--- branches/io_cleanups/src/pmc/pipe.pmc	Sun Jul 12 21:48:15 2009	(r40027)
+++ branches/io_cleanups/src/pmc/pipe.pmc	Sun Jul 12 22:10:06 2009	(r40028)
@@ -58,6 +58,7 @@
         PARROT_PIPEHANDLE(attrs->w)->writer = 1;
 
         PObj_custom_mark_SET(SELF);
+        PObj_active_destroy_SET(SELF);
     }
 
 
@@ -109,6 +110,25 @@
 
 /*
 
+=item C<void destroy()>
+
+Destroy a Pipe object.
+
+=cut
+
+*/
+
+    VTABLE void destroy() {
+        if (PARROT_PIPE(SELF)) {
+            Parrot_Pipe_attributes *attr = PARROT_PIPE(SELF);
+            mem_sys_free(attr);
+        }
+        PMC_data(SELF) = NULL;
+    }
+
+
+/*
+
 =back
 
 =head2 Methods


More information about the parrot-commits mailing list