Skip to content

Commit d43f8a5

Browse files
committed
add comment
1 parent dcd7fa8 commit d43f8a5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Modules/_decimal/_decimal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,6 +1499,11 @@ static int
14991499
context_clear(PyObject *op)
15001500
{
15011501
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. */
15021507
PyDecSignalDictObject *traps = _PyDecSignalDictObject_CAST(self->traps);
15031508
PyDecSignalDictObject *flags = _PyDecSignalDictObject_CAST(self->flags);
15041509

0 commit comments

Comments
 (0)