fix: dispose text painter to prevent memory leak (#2352)

This commit is contained in:
ggurdin 2025-04-03 16:53:16 -04:00 committed by GitHub
parent 00549978ef
commit 6888c8f152
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -188,7 +188,9 @@ class MessageTextWidget extends StatelessWidget {
maxLines: 1,
textDirection: TextDirection.ltr,
)..layout();
return textPainter.width;
final width = textPainter.width;
textPainter.dispose();
return width;
}
Color backgroundColor(BuildContext context, TokenPosition tokenPosition) {