From 15e3b12c34e7a5bae8ad8a0ec08cee3fe8d99360 Mon Sep 17 00:00:00 2001 From: akr Date: Wed, 27 Aug 2008 17:19:19 +0000 Subject: * include/ruby/io.h (rb_io_t): refcnt field removed. (MakeOpenFile): refcnt initialization removed. * io.c (rb_io_fptr_finalize): don't check refcnt. (rb_io_close_read): don't use refcnt. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 08a4e4e85..645df164c 100644 --- a/io.c +++ b/io.c @@ -3105,7 +3105,6 @@ int rb_io_fptr_finalize(rb_io_t *fptr) { if (!fptr) return 0; - if (fptr->refcnt <= 0 || --fptr->refcnt) return 0; fptr->pathv = Qnil; if (0 <= fptr->fd) rb_io_fptr_cleanup(fptr, Qtrue); @@ -3275,11 +3274,9 @@ rb_io_close_read(VALUE io) rb_io_t *wfptr; fptr_finalize(fptr, Qfalse); GetOpenFile(write_io, wfptr); - if (fptr->refcnt < LONG_MAX) { - wfptr->refcnt++; - RFILE(io)->fptr = wfptr; - rb_io_fptr_finalize(fptr); - } + RFILE(io)->fptr = wfptr; + RFILE(write_io)->fptr = NULL; + rb_io_fptr_finalize(fptr); return Qnil; } -- cgit