summaryrefslogtreecommitdiffhomepage
path: root/src/state.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-04-12 14:09:35 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-04-12 14:09:35 +0900
commitfcd6e4a7a444de7b6aaf2f0f38f3dbc043e8d495 (patch)
tree3bfadc6afdf0207edc5e5e1518fd841cdfca4991 /src/state.c
parent3308177c4d1a44120a1166f36624aff033e929e4 (diff)
parentd305a9dad701d2e21b3ca789820e6a78dc0e7b50 (diff)
downloadmruby-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.c4
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