From: Nicholas Clark <nick@ccl4.org>
Date: Thu, 25 Aug 2005 13:15:17 +0000 (+0000)
Subject: No need to manually set the reference count of a new IO to 1.
X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=158623e7a4731901256e91f86d41e023422b4150;p=p5sagit%2Fp5-mst-13.2.git

No need to manually set the reference count of a new IO to 1.

p4raw-id: //depot/perl@25329
---

diff --git a/gv.c b/gv.c
index 2726840..77ca69f 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);