Replies: 1 comment 4 replies
-
|
This is a non-issue. Whether So awaiting |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What actually happens when
ProviderContainer.dispose()is called and one of theonDisposecallbacks is asynchronous?I guess, since
disposeis not asynchronous, it won't wait for theasyncdisposal callback to finish. Most of the disposable things are actually asynchronous, like canceling stream subscription, closing stream controller, or websocket connection.Not waiting for the disposal callbacks may theoretically lead to some resources being not fully disposed, or some events (in case of streams) being partially processed, or not processed at all. This is probably less concerning in the case of Flutter app, but it's more of an issue for command-line tools or server applications.
Would it be possible to make
disposeasynchronous so that we can wait for all of the disposing callbacks to finish before we exit the app?Beta Was this translation helpful? Give feedback.
All reactions