Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Fix inner observer does not dispose parent on error #439

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

faidra
Copy link
Contributor

@faidra faidra commented Dec 17, 2019

this fixes #350 .

Merging operators (Merge, Switch, and SelectMany) doesn't dispose parent subscription when inner subscription calls OnError, and this causes some odd behaviours.

  • this is different from other combining operators (Zip, CombineLatest for instance)
  • this may send InvalidOperationException: Disposable is already set in some conditions
  • appending a operator (even AsObservable() ) changes the result

This change let they behave same as other operators.
(for example https://github.com/neuecc/UniRx/blob/master/Assets/Plugins/UniRx/Scripts/Operators/Zip.cs#L135-L141 )

@faidra faidra changed the title Dispose parent in inner observer's OnError Fix inner observer does not dispose parent on error Dec 17, 2019
SeungHuLee added a commit to SeungHuLee/UniRx that referenced this pull request Jan 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Merging operators don't dispose source observable when inner observable throws
1 participant