Skip to content

1.x: fix using() resource cleanup when factory throws or being non-eager#3922

Merged
akarnokd merged 1 commit intoReactiveX:1.xfrom
akarnokd:UsingCleanupFix
May 10, 2016
Merged

1.x: fix using() resource cleanup when factory throws or being non-eager#3922
akarnokd merged 1 commit intoReactiveX:1.xfrom
akarnokd:UsingCleanupFix

Conversation

@akarnokd
Copy link
Member

@akarnokd akarnokd commented May 9, 2016

The operator using didn't call the resource cleanup code if the observableFactory.call() code crashed. In addition, a non-eager using didn't call the resource cleanup if one subscribed with unsafeSubscribe or the subscription to the generated Observable crashed.

Related: #3921

Exceptions.throwIfFatal(e);
Exceptions.throwIfFatal(disposeError);
if (disposeError != null) {
subscriber.onError(new CompositeException(Arrays.asList(e, disposeError)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CompositeException accepts varargs right?

@akarnokd
Copy link
Member Author

Changes applied.

@stevegury
Copy link
Member

👍

@akarnokd akarnokd merged commit d43c05c into ReactiveX:1.x May 10, 2016
@akarnokd akarnokd deleted the UsingCleanupFix branch May 10, 2016 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants