develooper Front page | perl.perl5.porters | Postings from March 2000

[PATCH perl-current] perl_destruct fixes

Thread Next
From:
Doug MacEachern
Date:
March 6, 2000 23:22
Subject:
[PATCH perl-current] perl_destruct fixes
Message ID:
Pine.LNX.4.10.10003062259190.329-100000@mojo.covalent.net
without -Dusethreads, perl_construct dumps core when called twice in the
same process, patch below fixes.  i also noticed thread-multi leaks 12
bytes for each perl_construct...perl_destruct, but i'm out of time and on
a 6am flight.

--- perl.c~	Sun Mar  5 23:22:49 2000
+++ perl.c	Mon Mar  6 23:12:53 2000
@@ -393,6 +393,9 @@
 	PL_main_root = Nullop;
     }
     PL_curcop = &PL_compiling;
+#ifndef USE_ITHREADS
+    CopFILEGV_set(PL_curcop, Nullgv);
+#endif
     PL_main_start = Nullop;
     SvREFCNT_dec(PL_main_cv);
     PL_main_cv = Nullcv;
@@ -672,6 +675,7 @@
 
     /* free special SVs */
 
+#ifdef USE_ITHREADS
     SvREFCNT(&PL_sv_yes) = 0;
     sv_clear(&PL_sv_yes);
     SvANY(&PL_sv_yes) = NULL;
@@ -679,6 +683,7 @@
     SvREFCNT(&PL_sv_no) = 0;
     sv_clear(&PL_sv_no);
     SvANY(&PL_sv_no) = NULL;
+#endif
 
     if (PL_sv_count != 0 && ckWARN_d(WARN_INTERNAL))
 	Perl_warner(aTHX_ WARN_INTERNAL,"Scalars leaked: %ld\n", (long)PL_sv_count);


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About