Skip to content

CurvedAnimations not getting disposed #155

@raulmabe-labhouse

Description

@raulmabe-labhouse

Hello, I am debugging one of our applications that contains some memory leaks.

We are using the leak_tracker package to debug and get objects not being properly disposed. All of these warnings come from CurvedAnimations not being properly disposed. Moreover, we are using a lot flutter_animate for all of our animations, and we declare some SlideEffects and FadeEffects with a curve.

This is the stacktrace for the SlideEffect

                #7______FlutterMemoryAllocations.dispatchObjectEvent_(package:flutter/src/foundation/memory_allocations.dart:243:23)
                #8______FlutterMemoryAllocations.dispatchObjectCreated_(package:flutter/src/foundation/memory_allocations.dart:282:5)
                #9______new_CurvedAnimation_(package:flutter/src/animation/animations.dart:385:41)
                #10_____EffectEntry.buildAnimation_(package:flutter_animate/src/flutter_animate.dart:59:12)
                #11_____Effect.buildAnimation_(package:flutter_animate/src/effects/effect.dart:52:10)
                #12_____SlideEffect.build_(package:flutter_animate/src/effects/slide_effect.dart:38:17)
                #13______AnimateState.build_(package:flutter_animate/src/animate.dart:398:28)
                #14_____StatefulElement.build_(package:flutter/src/widgets/framework.dart:5841:27)
                #15_____ComponentElement.performRebuild_(package:flutter/src/widgets/framework.dart:5733:15)
                #16_____StatefulElement.performRebuild_(package:flutter/src/widgets/framework.dart:5892:11)
                #17_____Element.rebuild_(package:flutter/src/widgets/framework.dart:5445:7)
                #18_____ComponentElement._firstBuild_(package:flutter/src/widgets/framework.dart:5715:5)
                #19_____StatefulElement._firstBuild_(package:flutter/src/widgets/framework.dart:5883:11)
                #20_____ComponentElement.mount_(package:flutter/src/widgets/framework.dart:5709:5)
                #21_____Element.inflateWidget_(package:flutter/src/widgets/framework.dart:4555:16)

Is it possible that Effects are not disposing well its CurvedAnimation? By looking at the code I can't find where it is disposed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions