From: Mike Guy Date: Fri, 1 Sep 2000 14:16:01 +0000 (+0100) Subject: Part of the solution. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fd345fa8ff2d2c9d4bea826848c63a12821897de;p=p5sagit%2Fp5-mst-13.2.git Part of the solution. Subject: Re: [ID 20000807.004] [PATCH] conditional breakpoints leak memory Message-Id: p4raw-id: //depot/perl@6967 --- diff --git a/gv.c b/gv.c index 8cf40c7..3787f1b 100644 --- a/gv.c +++ b/gv.c @@ -75,7 +75,7 @@ Perl_gv_fetchfile(pTHX_ const char *name) gv_init(gv, PL_defstash, tmpbuf, tmplen, FALSE); sv_setpv(GvSV(gv), name); if (PERLDB_LINE) - hv_magic(GvHVn(gv_AVadd(gv)), gv, 'L'); + hv_magic(GvHVn(gv_AVadd(gv)), Nullgv, 'L'); } if (tmpbuf != smallbuf) Safefree(tmpbuf); @@ -735,7 +735,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) if (strEQ(name, "OVERLOAD")) { HV* hv = GvHVn(gv); GvMULTI_on(gv); - hv_magic(hv, gv, 'A'); + hv_magic(hv, Nullgv, 'A'); } break; case 'S': @@ -749,7 +749,7 @@ Perl_gv_fetchpv(pTHX_ const char *nambeg, I32 add, I32 sv_type) } GvMULTI_on(gv); hv = GvHVn(gv); - hv_magic(hv, gv, 'S'); + hv_magic(hv, Nullgv, 'S'); for (i = 1; PL_sig_name[i]; i++) { SV ** init; init = hv_fetch(hv, PL_sig_name[i], strlen(PL_sig_name[i]), 1); diff --git a/mg.c b/mg.c index 088ae0b..7712cac 100644 --- a/mg.c +++ b/mg.c @@ -292,7 +292,8 @@ Perl_mg_copy(pTHX_ SV *sv, SV *nsv, const char *key, I32 klen) for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) { if (isUPPER(mg->mg_type)) { sv_magic(nsv, - mg->mg_type == 'P' ? SvTIED_obj(sv, mg) : mg->mg_obj, + mg->mg_type == 'P' ? SvTIED_obj(sv, mg) : + (mg->mg_type == 'D' && mg->mg_obj) ? sv : mg->mg_obj, toLOWER(mg->mg_type), key, klen); count++; }