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

setState() called after dispose(): _ScaleTextState#d3c8e(lifecycle state: defunct, not mounted, tickers: tracking 6 tickers) #105

Closed
peterkapena opened this issue Sep 9, 2020 · 4 comments

Comments

@peterkapena
Copy link

Describe the bug
Hi,

I will just paste flutter debugger error info below:

Caught error: setState() called after dispose(): _ScaleTextState#d3c8e(lifecycle state: defunct, not mounted, tickers: tracking 6 tickers)
I/flutter ( 4414): 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.
I/flutter ( 4414): 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.
I/flutter ( 4414): 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().

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Navigate out of the parent widget where this widget is used'

Expected behavior
The error above is printed out.

Flutter:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.2, on Microsoft Windows [Version 10.0.19041.450], locale en-ZA)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
[√] Android Studio (version 4.0)
[√] VS Code (version 1.48.2)
[√] Connected device (1 available)

• No issues found!

@AadumKhor
Copy link
Collaborator

@peterkapena thanks for pointing this out, we did notice this but haven't merged it yet, you'll see this resolved in further updates to the package.

@awhitford
Copy link
Collaborator

I believe that PR #143 has resolved this.

@awhitford
Copy link
Collaborator

Please try the 2.5.2 release. Thanks!

@peterkapena
Copy link
Author

Please try the 2.5.2 release. Thanks!

All good, I haven't seen it happening again for months now

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

3 participants