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

Cancel async calls when disposing widgets (ot check the widget is mounted before doing setState()) #29

Open
andreiboyanov opened this issue May 25, 2018 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@andreiboyanov
Copy link
Owner

The following error can occur in the player_details screen:

[ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter ( 5367): setState() called after dispose(): _PlayerDetailsState#36821(lifecycle state: defunct, not mounted)
E/flutter ( 5367): This error happens if you call setState() on a State object for a widget that no longer appears in the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error can occur when code calls setState() from a timer or an animation callback. The preferred solution is to cancel the timer or stop listening to the animation in the dispose() callback. Another solution is to check the "mounted" property of this object before calling setState() to ensure the object is still in the tree.
E/flutter ( 5367): This error might indicate a memory leak if setState() is being called because another object is retaining a reference to this State object after it has been removed from the tree. To avoid memory leaks, consider breaking the reference to this object during dispose().

@andreiboyanov andreiboyanov self-assigned this May 25, 2018
@andreiboyanov andreiboyanov added the bug Something isn't working label May 25, 2018
@andreiboyanov andreiboyanov added this to the Perfection milestone May 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant