fix memory leak of new allocator

This commit is contained in:
blueloveTH 2025-02-05 19:17:32 +08:00
parent 1260987ead
commit ba25fd4710
2 changed files with 1 additions and 1 deletions

View File

@ -52,6 +52,7 @@ static int PoolArena__sweep_dealloc(PoolArena* self) {
} else {
if(!obj->gc_marked) {
// not marked, need to free
PyObject__dtor(obj);
obj->type = 0;
freed++;
self->unused[self->unused_length] = i;

View File

@ -49,7 +49,6 @@ bool py_deldict(py_Ref self, py_Name name) {
assert(self && self->is_ptr);
if(!py_ismagicname(name) || self->type != tp_type) {
return NameDict__del(PyObject__dict(self->_obj), name);
} else {
py_Type* ud = py_touserdata(self);
py_newnil(py_tpgetmagic(*ud, name));