summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-08-25 13:15:17 +0000
committerNicholas Clark <nick@ccl4.org>2005-08-25 13:15:17 +0000
commit158623e7a4731901256e91f86d41e023422b4150 (patch)
tree9a4fc6892dfe494713883354e6e555a29c99f290 /gv.c
parent60099296ceae90f439675352184edd07019ec071 (diff)
downloadperl-158623e7a4731901256e91f86d41e023422b4150.tar.gz
No need to manually set the reference count of a new IO to 1.
p4raw-id: //depot/perl@25329
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index 27268407e6..77ca69fa3b 100644
--- a/gv.c
+++ b/gv.c
@@ -1222,7 +1222,10 @@ Perl_newIO(pTHX)
IO * const io = (IO*)NEWSV(0,0);
sv_upgrade((SV *)io,SVt_PVIO);
- SvREFCNT(io) = 1;
+ /* This used to read SvREFCNT(io) = 1;
+ It's not clear why the reference count needed an explicit reset. NWC
+ */
+ assert (SvREFCNT(io) == 1);
SvOBJECT_on(io);
/* Clear the stashcache because a new IO could overrule a package name */
hv_clear(PL_stashcache);