Commit 706bfa1
Dave Wyatt
Weak references, more ReSharper
HostIoInterceptor's _subscribers field is now a list of weak references
to IHostIoSubscriber objects. This avoids a situation where someone
might either forget to detach a log file, or have a script crash before
that line executes, resulting in all of the remaining session's output
being captured.
Help files have been updated to reflect that the calling script must
hold a reference to the LogFile or ScriptBlockOutputSubscriber objects
to keep them alive. Once the garbage collector comes along, that's all
she wrote.
Also removed the WriteHost method from IHostIoSubscriber, since it
wasn't being called by HostIoInterceptor anyway (that gets sent through
WriteOutput).1 parent d44c597 commit 706bfa1
10 files changed
Lines changed: 338 additions & 174 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
3 | 7 | | |
4 | 8 | | |
5 | 9 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
0 commit comments