id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,lang,patch,platform
564,[BUG] pmc_reuse() doesn't call old PMC's destroy(),cotto,,"In src/pmc.c, the function pmc_reuse() is used as a lightweight way to recycle a PMC by only destroying the unique parts of a PMC.  It looks like this function has the potential for resource leaks since it doesn't call the old PMC's destroy() VTABLE function.  The inlined patch fixes this.  There are no new test failures, but it still seems wise to wait until after the 1.1 release to apply it, since it's only 24-48 hours away.

{{{
Index: src/pmc.c
===================================================================
--- src/pmc.c   (revision 38235)
+++ src/pmc.c   (working copy)
@@ -188,6 +188,10 @@
     /* Do we have an extension area? */
     has_ext = (PObj_is_PMC_EXT_TEST(pmc) && pmc->pmc_ext);
 
+    /* Does the old PMC need any resources freed? */
+    if (PObj_active_destroy_TEST(pmc))
+        VTABLE_destroy(interp, pmc);
+
     /* Do we need one? */
     if (new_vtable->flags & VTABLE_PMC_NEEDS_EXT) {
}}}",bug,closed,normal,1.1,none,,medium,fixed,,,,,
