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 | 15e3b12c34e7a5bae8ad8a0ec08cee3fe8d99360 (patch) | |
tree | 98c2085300ced7e05b99b7c97b169a60875602b4 /io.c | |
parent | 72726f845ddb2368f41084d11c76118172b6e0a9 (diff) | |
download | ruby-15e3b12c34e7a5bae8ad8a0ec08cee3fe8d99360.tar.gz ruby-15e3b12c34e7a5bae8ad8a0ec08cee3fe8d99360.tar.xz ruby-15e3b12c34e7a5bae8ad8a0ec08cee3fe8d99360.zip |
* 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
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; } |