diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-16 09:03:12 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-16 09:03:12 +0000 |
| commit | 3ffca49a48e4aef9232b2056c8f3352d37368db7 (patch) | |
| tree | 9ab0899a81314afb81d24b4cec5113851774bb68 | |
| parent | 51f02022da14e5ebf0f0b5516f59c6e31d5fff59 (diff) | |
| download | ruby-3ffca49a48e4aef9232b2056c8f3352d37368db7.tar.gz ruby-3ffca49a48e4aef9232b2056c8f3352d37368db7.tar.xz ruby-3ffca49a48e4aef9232b2056c8f3352d37368db7.zip | |
* io.c (pipe_open, rb_io_s_popen): clear temporary object to release
and prevent from GC.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | io.c | 2 |
2 files changed, 7 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Wed Jan 16 18:03:10 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (pipe_open, rb_io_s_popen): clear temporary object to release + and prevent from GC. + Wed Jan 16 17:55:07 2008 NAKAMURA Usaku <usa@ruby-lang.org> * numeric.c (fix_quo): typo. a patch from Shin-ichiro HARA @@ -3626,6 +3626,7 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode) exename = cmd; cmdbuf = rb_str_tmp_new(rb_w32_argv_size(args)); cmd = rb_w32_join_argv(RSTRING_PTR(cmdbuf), args); + rb_str_resize(argbuf, 0); } while ((pid = rb_w32_pipe_exec(cmd, exename, openmode, &fd, &write_fd)) == -1) { /* exec failed */ @@ -3775,6 +3776,7 @@ rb_io_s_popen(int argc, VALUE *argv, VALUE klass) tmp = rb_ary_dup(tmp); RBASIC(tmp)->klass = 0; port = pipe_open_v(RARRAY_LEN(tmp), RARRAY_PTR(tmp), mode); + rb_ary_clear(tmp); } else { SafeStringValue(pname); |
