Commit e371f39
committed
sshfs: make _finalize method static to allow garbage collection
Using a bound method with weakref.finalize was keeping a reference
to the `SSHFileSystem` instance, preventing it from being garbage
collected.
See note at the end of the Python documentation for [`weakref.finalize`][1]:
> Note: It is important to ensure that func, args and kwargs do not own any references to obj,
> either directly or indirectly, since otherwise obj will never be garbage collected.
> In particular, func should not be a bound method of obj.
[1]: https://docs.python.org/3/library/weakref.html#weakref.finalize1 parent 5c32631 commit e371f39
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
0 commit comments