mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ext/objspace/object_tracing.c (freeobj_i): no lookup before delete
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
870c296d00
commit
8eb96c6137
1 changed files with 6 additions and 5 deletions
|
@ -121,13 +121,14 @@ freeobj_i(VALUE tpval, void *data)
|
|||
st_data_t v;
|
||||
struct allocation_info *info;
|
||||
|
||||
if (st_lookup(arg->object_table, obj, &v)) {
|
||||
info = (struct allocation_info *)v;
|
||||
if (arg->keep_remains) {
|
||||
if (arg->keep_remains) {
|
||||
if (st_lookup(arg->object_table, obj, &v)) {
|
||||
info = (struct allocation_info *)v;
|
||||
info->living = 0;
|
||||
}
|
||||
else {
|
||||
st_delete(arg->object_table, &obj, &v);
|
||||
}
|
||||
else {
|
||||
if (st_delete(arg->object_table, &obj, &v)) {
|
||||
delete_unique_str(arg->str_table, info->path);
|
||||
delete_unique_str(arg->str_table, info->class_path);
|
||||
ruby_xfree(info);
|
||||
|
|
Loading…
Reference in a new issue