Fix memory leak in Form (#132987)
Diposes some restorable variables that weren't disposed before.
This commit is contained in:
parent
b3005a318b
commit
0278671bda
@ -573,6 +573,13 @@ class FormFieldState<T> extends State<FormField<T>> with RestorationMixin {
|
|||||||
super.deactivate();
|
super.deactivate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_errorText.dispose();
|
||||||
|
_hasInteractedByUser.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (widget.enabled) {
|
if (widget.enabled) {
|
||||||
|
@ -247,9 +247,6 @@ void main() {
|
|||||||
},
|
},
|
||||||
variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.windows }),
|
variant: const TargetPlatformVariant(<TargetPlatform>{ TargetPlatform.linux, TargetPlatform.windows }),
|
||||||
skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web.
|
skip: kIsWeb, // [intended] we don't supply the cut/copy/paste buttons on the web.
|
||||||
// TODO(polina-c): remove after fixing
|
|
||||||
// https://github.com/flutter/flutter/issues/130467
|
|
||||||
leakTrackingTestConfig: const LeakTrackingTestConfig(allowAllNotDisposed: true, allowAllNotGCed: true),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
testWidgetsWithLeakTracking(
|
testWidgetsWithLeakTracking(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user