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);
|
GPU_batch_discard(self->batch);
|
||||||
|
|
||||||
#ifdef USE_GPU_PY_REFERENCES
|
#ifdef USE_GPU_PY_REFERENCES
|
||||||
|
PyObject_GC_UnTrack(self);
|
||||||
if (self->references) {
|
if (self->references) {
|
||||||
PyObject_GC_UnTrack(self);
|
|
||||||
pygpu_batch__tp_clear(self);
|
pygpu_batch__tp_clear(self);
|
||||||
Py_XDECREF(self->references);
|
Py_XDECREF(self->references);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,8 +202,7 @@ static void pygpu_buffer__tp_dealloc(BPyGPUBuffer *self)
|
|||||||
{
|
{
|
||||||
if (self->parent) {
|
if (self->parent) {
|
||||||
PyObject_GC_UnTrack(self);
|
PyObject_GC_UnTrack(self);
|
||||||
pygpu_buffer__tp_clear(self);
|
Py_CLEAR(self->parent);
|
||||||
Py_XDECREF(self->parent);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
MEM_freeN(self->buf.as_void);
|
MEM_freeN(self->buf.as_void);
|
||||||
|
|||||||
@@ -203,10 +203,8 @@ static const EnumPropertyItem property_subtype_array_items[] = {
|
|||||||
|
|
||||||
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
|
static void bpy_prop_deferred_dealloc(BPy_PropDeferred *self)
|
||||||
{
|
{
|
||||||
if (self->kw) {
|
PyObject_GC_UnTrack(self);
|
||||||
PyObject_GC_UnTrack(self);
|
Py_CLEAR(self->kw);
|
||||||
Py_CLEAR(self->kw);
|
|
||||||
}
|
|
||||||
PyObject_GC_Del(self);
|
PyObject_GC_Del(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user