Commit 51e72ae
committed
Hold a strong reference to the client in _ControllerProxy
The proxy stored weakref.proxy(client), but nothing else kept the
client alive, so the one-expression idiom
SpaceTrackClient(...).basicspacedata.gp(...) collected the client
mid-expression and raised ReferenceError, and hasattr/getattr on a
proxy that outlived its client raised ReferenceError instead of
reporting the attribute missing. The client-to-proxy reference cycle
this creates is handled by the garbage collector, and the finalizer
still fires because it does not reference the instance.1 parent 168de31 commit 51e72ae
3 files changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1090 | 1090 | | |
1091 | 1091 | | |
1092 | 1092 | | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
| 1093 | + | |
1096 | 1094 | | |
1097 | 1095 | | |
1098 | 1096 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
371 | 381 | | |
372 | 382 | | |
373 | 383 | | |
| |||
0 commit comments