summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-12-16 06:48:13 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-12-18 09:51:09 +0000
commit30985c42177cbe6a80b41e614f8691b272398f01 (patch)
tree41b4b918a1368afebefe8d5ce97f56d6b2991f26 /perl.c
parent5f1992ede8a43d5dd061f69ed393bbd52e8e5801 (diff)
downloadperl-30985c42177cbe6a80b41e614f8691b272398f01.tar.gz
perl.c: leak avoidance
Message-ID: <4584234D.7070209@iki.fi> p4raw-id: //depot/perl@29574
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/perl.c b/perl.c
index 0f242d73b6..de3b277088 100644
--- a/perl.c
+++ b/perl.c
@@ -792,19 +792,6 @@ perl_destruct(pTHXx)
PL_exitlist = NULL;
PL_exitlistlen = 0;
- if (destruct_level == 0){
-
- DEBUG_P(debprofdump());
-
-#if defined(PERLIO_LAYERS)
- /* No more IO - including error messages ! */
- PerlIO_cleanup(aTHX);
-#endif
-
- /* The exit() function will do everything that needs doing. */
- return STATUS_EXIT;
- }
-
/* jettison our possibly duplicated environment */
/* if PERL_USE_SAFE_PUTENV is defined environ will not have been copied
* so we certainly shouldn't free it here
@@ -831,6 +818,22 @@ perl_destruct(pTHXx)
#endif
#endif /* !PERL_MICRO */
+ if (destruct_level == 0) {
+
+ DEBUG_P(debprofdump());
+
+#if defined(PERLIO_LAYERS)
+ /* No more IO - including error messages ! */
+ PerlIO_cleanup(aTHX);
+#endif
+
+ CopFILE_free(&PL_compiling);
+ CopSTASH_free(&PL_compiling);
+
+ /* The exit() function will do everything that needs doing. */
+ return STATUS_EXIT;
+ }
+
/* reset so print() ends up where we expect */
setdefout(NULL);