diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-27 17:19:19 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-27 17:19:19 +0000 |
commit | a08b97c2f6c5ef85a3d8eee0eaf73015612316b5 (patch) | |
tree | 98c2085300ced7e05b99b7c97b169a60875602b4 /io.c | |
parent | c28edc50123f7a58666e090cf9e440b25dd44aab (diff) | |
download | ruby-a08b97c2f6c5ef85a3d8eee0eaf73015612316b5.tar.gz |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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; } |