diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | io.c | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Thu Oct 2 05:32:17 2014 Eric Wong <e@80x24.org> + + * io.c (fptr_finalize): free memory before GC sweep + [ruby-core:65269] [Feature #10295] + Thu Oct 2 05:27:24 2014 Eric Wong <e@80x24.org> * marshal.c (w_class): check dump_arg->compat_tbl before lookup @@ -4251,6 +4251,9 @@ maygvl_fclose(FILE *file, int keepgvl) return (int)(intptr_t)rb_thread_call_without_gvl(nogvl_fclose, file, RUBY_UBF_IO, 0); } +static void free_io_buffer(rb_io_buffer_t *buf); +static void clear_codeconv(rb_io_t *fptr); + static void fptr_finalize(rb_io_t *fptr, int noraise) { @@ -4312,6 +4315,9 @@ fptr_finalize(rb_io_t *fptr, int noraise) rb_exc_raise(err); } } + free_io_buffer(&fptr->rbuf); + free_io_buffer(&fptr->wbuf); + clear_codeconv(fptr); } static void |