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

Codec: setState() called after dispose() #55

Open
deobald opened this issue Mar 14, 2021 · 0 comments
Open

Codec: setState() called after dispose() #55

deobald opened this issue Mar 14, 2021 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@deobald
Copy link
Member

deobald commented Mar 14, 2021

Does not affect the UI. However, when running the app, this appears in the console:

flutter: ══╡ EXCEPTION CAUGHT BY IMAGE RESOURCE SERVICE ╞════════════════════════════════════════════════════
flutter: The following assertion was thrown resolving an image codec:
flutter: setState() called after dispose(): _OverlayInspirationCardState#1800b(lifecycle state: defunct, not
flutter: mounted)
flutter: This error happens if you call setState() on a State object for a widget that no longer appears in
flutter: the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
flutter: can occur when code calls setState() from a timer or an animation callback.
flutter: The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
flutter: callback. Another solution is to check the "mounted" property of this object before calling
flutter: setState() to ensure the object is still in the tree.
flutter: This error might indicate a memory leak if setState() is being called because another object is
flutter: retaining a reference to this State object after it has been removed from the tree. To avoid memory
flutter: leaks, consider breaking the reference to this object during dispose().
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1208:9)
flutter: #1      State.setState (package:flutter/src/widgets/framework.dart:1243:6)
flutter: #2      _OverlayInspirationCardState.build.<anonymous closure> (package:patta/ui/common_widgets/cards/OverlayInspirationCard.dart:108:25)
flutter: #3      CachedNetworkImageProvider._loadAsync (package:cached_network_image/src/image_provider/_image_provider_io.dart:128:19)
flutter: <asynchronous suspension>
flutter: #4      CachedNetworkImageProvider.load (package:cached_network_image/src/image_provider/_image_provider_io.dart:79:14)
flutter: #5      ImageProvider.resolveStreamForKey.<anonymous closure> (package:flutter/src/painting/image_provider.dart:504:13)
flutter: #6      ImageCache.putIfAbsent (package:flutter/src/painting/image_cache.dart:355:22)
flutter: #7      ImageProvider.resolveStreamForKey (package:flutter/src/painting/image_provider.dart:502:83)
flutter: #8      ScrollAwareImageProvider.resolveStreamForKey (package:flutter/src/widgets/scroll_aware_image_provider.dart:108:19)
flutter: #9      ImageProvider.resolve.<anonymous closure> (package:flutter/src/painting/image_provider.dart:333:9)
@deobald deobald added the bug Something isn't working label Mar 14, 2021
@deobald deobald added this to the v1 milestone Mar 14, 2021
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
Status: No status
Development

No branches or pull requests

2 participants