summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2009-08-05 15:23:41 +0100
committerDavid Mitchell <davem@iabyn.com>2009-08-05 15:48:19 +0100
commit02784d74952049f63fc33e0ce922ee6aa93bf665 (patch)
tree44a985081e5777622cf50193799dcdaa527973d0
parent5eccd2e5c682a62b41aeaf2548eca3607486aad9 (diff)
downloadperl-02784d74952049f63fc33e0ce922ee6aa93bf665.tar.gz
in perl_clone_using, free the prt_table
*after* we have called any CLONE methods (better fix for Variable::Magic than 240bfeb992) (cherry picked from commit b0b93b3c773176a99136baa97661d11503277415)
-rw-r--r--sv.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sv.c b/sv.c
index a251b21ee8..d2fcb0c58b 100644
--- a/sv.c
+++ b/sv.c
@@ -12109,11 +12109,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_registered_mros = hv_dup_inc(proto_perl->Iregistered_mros, param);
- if (!(flags & CLONEf_KEEP_PTR_TABLE)) {
- ptr_table_free(PL_ptr_table);
- PL_ptr_table = NULL;
- }
-
/* Call the ->CLONE method, if it exists, for each of the stashes
identified by sv_dup() above.
*/
@@ -12133,6 +12128,12 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
}
}
+ if (!(flags & CLONEf_KEEP_PTR_TABLE)) {
+ ptr_table_free(PL_ptr_table);
+ PL_ptr_table = NULL;
+ }
+
+
SvREFCNT_dec(param->stashes);
/* orphaned? eg threads->new inside BEGIN or use */