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

whiteknight at svn.parrot.org whiteknight at svn.parrot.org
Thu Jun 25 00:18:48 UTC 2009


Author: whiteknight
Date: Thu Jun 25 00:18:48 2009
New Revision: 39760
URL: https://trac.parrot.org/parrot/changeset/39760

Log:
[io_cleanups] reapply my fix to socket to plug a memory leak here

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

Modified: branches/io_cleanups/src/pmc/socket.pmc
==============================================================================
--- branches/io_cleanups/src/pmc/socket.pmc	Thu Jun 25 00:11:31 2009	(r39759)
+++ branches/io_cleanups/src/pmc/socket.pmc	Thu Jun 25 00:18:48 2009	(r39760)
@@ -97,12 +97,13 @@
 
 */
     VTABLE void destroy() {
-        if (PARROT_SOCKET(SELF)) {
-            Parrot_Socket_attributes *data_struct = PARROT_SOCKET(SELF);
+        Parrot_Socket_attributes * const data_struct = PARROT_SOCKET(SELF);
+        if (data_struct) {
 
             if (data_struct->os_handle != PIO_INVALID_HANDLE)
                 Parrot_io_close_piohandle(interp, data_struct->os_handle);
             data_struct->os_handle = PIO_INVALID_HANDLE;
+            mem_sys_free(data_struct);
         }
     }
 


More information about the parrot-commits mailing list