public void OnError(Exception error) { if (Interlocked.Increment(ref isStopped) == 1) { parent.lastException = error; parent.publisher?.OnError(error); parent.Dispose(); } }
public void OnError(Exception error) { if (System.Threading.Interlocked.Increment(ref isStopped) == 1) { parent.lastException = error; var p = parent.publisher; if (p != null) { p.OnError(error); } parent.Dispose(); // complete subscription } }