We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcd7fa8 commit d43f8a5Copy full SHA for d43f8a5
1 file changed
Modules/_decimal/_decimal.c
@@ -1499,6 +1499,11 @@ static int
1499
context_clear(PyObject *op)
1500
{
1501
PyDecContextObject *self = _PyDecContextObject_CAST(op);
1502
+ /* Since traps and flags hold a borrowed reference to the
1503
+ flags stored in the context object, these references need
1504
+ to be cleared when the context object is deallocated
1505
+ because other objects could hold references to the
1506
+ traps and/or flags objects. See gh-146011. */
1507
PyDecSignalDictObject *traps = _PyDecSignalDictObject_CAST(self->traps);
1508
PyDecSignalDictObject *flags = _PyDecSignalDictObject_CAST(self->flags);
1509
0 commit comments