diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-12 14:09:35 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-04-12 14:09:35 +0900 |
| commit | fcd6e4a7a444de7b6aaf2f0f38f3dbc043e8d495 (patch) | |
| tree | 3bfadc6afdf0207edc5e5e1518fd841cdfca4991 /src/state.c | |
| parent | 3308177c4d1a44120a1166f36624aff033e929e4 (diff) | |
| parent | d305a9dad701d2e21b3ca789820e6a78dc0e7b50 (diff) | |
| download | mruby-fcd6e4a7a444de7b6aaf2f0f38f3dbc043e8d495.tar.gz mruby-fcd6e4a7a444de7b6aaf2f0f38f3dbc043e8d495.zip | |
Merge pull request #2049 from ksss/str-dup
mrb_str_dup return shared string instead of new string
Diffstat (limited to 'src/state.c')
| -rw-r--r-- | src/state.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/state.c b/src/state.c index 3dfeed5dc..1e26f49cf 100644 --- a/src/state.c +++ b/src/state.c @@ -134,9 +134,7 @@ mrb_irep_free(mrb_state *mrb, mrb_irep *irep) mrb_free(mrb, irep->iseq); for (i=0; i<irep->plen; i++) { if (mrb_type(irep->pool[i]) == MRB_TT_STRING) { - if ((mrb_str_ptr(irep->pool[i])->flags & (MRB_STR_NOFREE|MRB_STR_EMBED)) == 0) { - mrb_free(mrb, RSTRING_PTR(irep->pool[i])); - } + mrb_gc_free_str(mrb, RSTRING(irep->pool[i])); mrb_free(mrb, mrb_obj_ptr(irep->pool[i])); } #ifdef MRB_WORD_BOXING |
