Closed mrakgr closed 4 years ago
There's another problem here.
If either is a CompositeDisposable
, it gets mutated.
I've used this pattern before -
let group1 = Disposable.compose dis1 dis2
...
let group2 = Disposable.compose group1 dis3
In this example, group1
would be mutated behind the scenes, and when it's disposed, dis3
would be called as well. I propose making compose
pure, and add another ofSeq
method to capture multiple disposables,
Factored this out to a separate issue. See #140
I agree that compose
should be pure. Let me close this since implementing it in a pure fashion would resolve this. I missed that troublesome aspect of the way it is currently implemented. Well spotted.
When freeing unmanaged resources sometimes the order matters. In every case but...
d
is freed first and thenx
after that. Personally I'd flag this as a bug and just remove the line, but I am wondering what the others here think? Also, I'd add a comment to indicate which argument is disposed first and which last. I know thatd
has lower precedence thanx
in the alphabet which alludes to the order, but those inferences are a stretch.