Skip to content

Commit

Permalink
Fixup #14924: again use weak references for functions (#15215)
Browse files Browse the repository at this point in the history
Fixup of #14924

Summary of the issue:
In #14627, we introduced weak references for APCs called as part of a waitable timer. In #14924, this was made more robust by using a single internal APC func. However in the porting process, a part of the logic was reversed, therefore in the internal APC store, we still stored strong rather than weak references.

Description of user facing changes
None.

Description of development approach
Store references instead of functions in the apc store.
  • Loading branch information
LeonarddeR committed Jul 30, 2023
1 parent 249985e commit 35c2d1d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/hwIo/ioThread.py
Expand Up @@ -186,7 +186,7 @@ def _registerToCallAsApc(
reference = BoundMethodWeakref(func) if ismethod(func) else AnnotatableWeakref(func)
reference.funcName = repr(func)

self._apcStore[internalParam] = (func or reference, param)
self._apcStore[internalParam] = (reference or func, param)
return internalParam

def queueAsApc(
Expand Down

0 comments on commit 35c2d1d

Please sign in to comment.