simc / auto_size_text

Flutter widget that automatically resizes text to fit perfectly within its bounds.
https://pub.dev/packages/auto_size_text
MIT License
2.06k stars 240 forks source link

Memory leak on TextPainter #150

Open tmpsantos opened 1 month ago

tmpsantos commented 1 month ago

Running the unit tests with leak tracker enabled will fail because TextPainter is not being disposed. Fix on #149

  Expected: leak free
    Actual: <Instance of 'Leaks'>
     Which: contains leaks:
            # The text is generated by leak_tracker.
            # For leak troubleshooting tips open:
            # https://github.com/dart-lang/leak_tracker/blob/main/doc/TROUBLESHOOT.md
            notDisposed:
              total: 140
              objects:
                TextPainter:
                  test: Group sync
                  identityHashCode: 360054994
                TextPainter:
                  test: Group sync
                  identityHashCode: 134151191
                TextPainter:
                  test: Group sync
                  identityHashCode: 490481355
                TextPainter:
                  test: Group sync
                  identityHashCode: 494110995
                TextPainter:
                  test: Group sync
                  identityHashCode: 664187944
                TextPainter:
                  test: Group sync
                  identityHashCode: 689149618