mirror of
https://github.com/ruby/ruby.git
synced 2026-01-26 12:14:51 +00:00
free the entry after deleting the reference
This commit is contained in:
parent
be118cf946
commit
1c81bbf035
Notes:
git
2025-10-26 08:50:18 +00:00
7
class.c
7
class.c
@ -613,17 +613,18 @@ remove_class_from_subclasses(struct st_table *tbl, VALUE ns_id, VALUE klass)
|
||||
next->prev = prev;
|
||||
}
|
||||
|
||||
xfree(entry);
|
||||
|
||||
if (first_entry) {
|
||||
if (next) {
|
||||
st_update(tbl, ns_id, remove_class_from_subclasses_replace_first_entry, (st_data_t)next);
|
||||
}
|
||||
else {
|
||||
// no subclass entries in this ns
|
||||
// no subclass entries in this ns after the deletion
|
||||
st_delete(tbl, &ns_id, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
xfree(entry);
|
||||
|
||||
break;
|
||||
}
|
||||
else if (first_entry) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user