Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxCommand from stream failed to dispose fully #44

Closed
baku-apps opened this issue Jun 26, 2020 · 4 comments
Closed

RxCommand from stream failed to dispose fully #44

baku-apps opened this issue Jun 26, 2020 · 4 comments

Comments

@baku-apps
Copy link

I'm creating a RxCommand from a stream with a timeout. After disposing the RxCommand the timeout still emits and an exception is thrown.

 var command = RxCommand.createFromStream(
     (_) => someBroadcastStream
     .timeout(Duration(milliseconds: 1000))
     .onErrorResume((e) => e.add('do something')));
   
   command();
   command.dispose();

Exception is thrown rx_command.dart line 642
It looks like the inputObservable is not closed on dispose, so it is still listening to emitted notifications (i.e. from the timeout exception). Should this subscription also be disposed?

@escamoteur
Copy link
Collaborator

I think I found it. Can you try V version: 5.1.0+test?

@baku-apps
Copy link
Author

Awesome, thanks for the quick fix!

@escamoteur
Copy link
Collaborator

so everything works?

@baku-apps
Copy link
Author

Yes, the input stream subscription is now disposed so does not emit the timeout error anymore. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants