Fix logic for calling PyObject_GC_UnTrack
All tracked objects need a matching un-track, also remove redundant Py_XDECREF call.
This commit is contained in:
@@ -279,8 +279,8 @@ static void pygpu_batch__tp_dealloc(BPyGPUBatch *self)
|
||||
GPU_batch_discard(self->batch);
|
||||
|
||||
#ifdef USE_GPU_PY_REFERENCES
|
||||
PyObject_GC_UnTrack(self);
|
||||
if (self->references) {
|
||||
PyObject_GC_UnTrack(self);
|
||||
pygpu_batch__tp_clear(self);
|
||||
Py_XDECREF(self->references);
|
||||
}
|
||||
|
@@ -202,8 +202,7 @@ static void pygpu_buffer__tp_dealloc(BPyGPUBuffer *self)
|
||||
{
|
||||
if (self->parent) {
|
||||
PyObject_GC_UnTrack(self);
|
||||
pygpu_buffer__tp_clear(self);
|
||||
Py_XDECREF(self->parent);
|
||||
Py_CLEAR(self->parent);
|
||||
}
|
||||
else {
|
||||
MEM_freeN(self->buf.as_void);
|
||||
|
Reference in New Issue
Block a user