(retracted by #16415) Storable: try to free what we allocated.
Jarkko Hietaniemi [Sat, 4 May 2002 18:25:01 +0000 (18:25 +0000)]
p4raw-id: //depot/perl@16401

ext/Storable/Storable.xs

index 05705c0..38843f6 100644 (file)
@@ -389,6 +389,8 @@ static stcxt_t *Context_ptr = &Context;
 
 #endif /* MULTIPLICITY || PERL_OBJECT || PERL_CAPI */
 
+XS(XS_Storable_END); /* free perinterp_sv and kbuf */
+
 /*
  * KNOWN BUG:
  *   Croaking implies a memory leak, since we don't use setjmp/longjmp
@@ -5426,3 +5428,16 @@ is_storing()
 int
 is_retrieving()
 
+void
+END()
+PPCODE:
+{   
+       dSTCXT;
+#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || defined(PERL_CAPI)
+       Safefree(INT2PTR(stcxt_t*, perinterp_sv));
+       perinterp_sv = 0;
+#endif
+       Safefree(kbuf);
+       kbuf = 0;
+       ksiz = 0;
+}