Skip to content

Commit 022d71e

Browse files
committed
revert the revert
1 parent 833a85e commit 022d71e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Modules/_tkinter.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2771,8 +2771,10 @@ static void
27712771
Tktt_Dealloc(PyObject *op)
27722772
{
27732773
PyTypeObject *tp = Py_TYPE(op);
2774+
printf("%p\n", ((TkttObject *)op)->func);
27742775
PyObject_GC_UnTrack(op);
2775-
(void)Tktt_Clear(op);
2776+
TkttObject *self = TkttObject_CAST(op);
2777+
Py_XDECREF(self->func);
27762778
tp->tp_free(op);
27772779
Py_DECREF(tp);
27782780
}
@@ -3094,7 +3096,7 @@ Tkapp_Dealloc(PyObject *op)
30943096
ENTER_TCL
30953097
Tcl_DeleteInterp(Tkapp_Interp(self));
30963098
LEAVE_TCL
3097-
(void)Tkapp_Clear(op);
3099+
Py_XDECREF(self->trace);
30983100
tp->tp_free(self);
30993101
Py_DECREF(tp);
31003102
DisableEventHook();
@@ -3295,7 +3297,7 @@ static PyMethodDef Tktt_methods[] =
32953297
};
32963298

32973299
static PyType_Slot Tktt_Type_slots[] = {
3298-
{Py_tp_clear, Tktt_Clear},
3300+
// {Py_tp_clear, Tktt_Clear},
32993301
{Py_tp_dealloc, Tktt_Dealloc},
33003302
{Py_tp_traverse, Tktt_Traverse},
33013303
{Py_tp_repr, Tktt_Repr},
@@ -3356,7 +3358,7 @@ static PyMethodDef Tkapp_methods[] =
33563358
};
33573359

33583360
static PyType_Slot Tkapp_Type_slots[] = {
3359-
{Py_tp_clear, Tkapp_Clear},
3361+
// {Py_tp_clear, Tkapp_Clear},
33603362
{Py_tp_dealloc, Tkapp_Dealloc},
33613363
{Py_tp_traverse, Tkapp_Traverse},
33623364
{Py_tp_methods, Tkapp_methods},

0 commit comments

Comments
 (0)