* variable.c (autoload_delete, autoload_file): should not delete

autoload table, since it may be shared with duplicated modules.
  [ruby-core:19181]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-10-08 02:18:15 +00:00
Родитель baeeebf474
Коммит d011b2e3ef
2 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Oct 8 11:18:12 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* variable.c (autoload_delete, autoload_file): should not delete
autoload table, since it may be shared with duplicated modules.
[ruby-core:19181]
Wed Oct 8 02:38:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org> Wed Oct 8 02:38:28 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* encoding.c (rb_default_internal_encoding): merged a patch from * encoding.c (rb_default_internal_encoding): merged a patch from

Просмотреть файл

@ -1374,12 +1374,8 @@ autoload_delete(VALUE mod, ID id)
st_delete(tbl, (st_data_t*)&id, &load); st_delete(tbl, (st_data_t*)&id, &load);
if (tbl->num_entries == 0) { if (tbl->num_entries == 0) {
DATA_PTR(val) = 0;
st_free_table(tbl);
id = autoload; id = autoload;
if (st_delete(RCLASS_IV_TBL(mod), (st_data_t*)&id, &val)) { st_delete(RCLASS_IV_TBL(mod), (st_data_t*)&id, &val);
rb_gc_force_recycle(val);
}
} }
} }
@ -1421,12 +1417,8 @@ autoload_file(VALUE mod, ID id)
/* already loaded but not defined */ /* already loaded but not defined */
st_delete(tbl, (st_data_t*)&id, 0); st_delete(tbl, (st_data_t*)&id, 0);
if (!tbl->num_entries) { if (!tbl->num_entries) {
DATA_PTR(val) = 0;
st_free_table(tbl);
id = autoload; id = autoload;
if (st_delete(RCLASS_IV_TBL(mod), (st_data_t*)&id, &val)) { st_delete(RCLASS_IV_TBL(mod), (st_data_t*)&id, &val);
rb_gc_force_recycle(val);
}
} }
return Qnil; return Qnil;
} }