Commit 1f7c1a5
committed
usb1: Replace lambda in finalizer argument with partial
While it seems the lambda instance does not keep a reference to
setPollFDNotifiers's stack cell (which would cause the finalizer to keep a
reference to the object it is monitoring, preventing proper finalization)
in cPython 3.11, I am not confident this would be also the case in other
implementations and versions. I do not expect functools.partial instances
to keep any reference to their call stack, so they seem safer in such
reference-sensitive context.1 parent 191c878 commit 1f7c1a5
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2430 | 2430 | | |
2431 | 2431 | | |
2432 | 2432 | | |
2433 | | - | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
2434 | 2437 | | |
2435 | 2438 | | |
2436 | 2439 | | |
| |||
0 commit comments