We have recently ported the system from RX 1.11111 to RX 2.0 and discovered this problem. We use an EventLoopScheduler for ObserveOn like this:
IDisposable s
Partially solved. The case was more complicated then shown here. The chain went like this:
var published = someSubject.ObserveOn(m_eventLoopScheduler).SomeMoreRXFunctions().Publish();
IDisposable disposable1 = published.Connect();
IDisposable disposable2 = published.Subscribe((something)=>something);
If I disposed both disposable1 and disposable2 the code in SomeMoreRXFunctions() wasn't executed any more. On the other hand trying to dispose the scheduler itself still throws the same exception.
Unfortunately I can't reproduce the issue in simpler code. That's probably an indication there's something else I'm missing.
This is a solution we can live with, but still I would love to find something better that closes the scheduler all at once with no chance of exceptions.