fix: dispose text painter to prevent memory leak (#2352)
This commit is contained in:
parent
00549978ef
commit
6888c8f152
1 changed files with 3 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue