File tree Expand file tree Collapse file tree 3 files changed +5
-1
lines changed
benchmarks/macrobenchmarks/lib/src
integration_tests/wide_gamut_test/lib Expand file tree Collapse file tree 3 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Future<ui.Image> loadImage(String asset) async {
10
10
final ui.ImmutableBuffer buffer = await ui.ImmutableBuffer .fromAsset (asset);
11
11
final ui.Codec codec = await PaintingBinding .instance.instantiateImageCodecWithSize (buffer);
12
12
final ui.FrameInfo frameInfo = await codec.getNextFrame ();
13
+ codec.dispose ();
13
14
return frameInfo.image;
14
15
}
15
16
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Future<ui.Image> loadImage(String asset) async {
10
10
final ui.ImmutableBuffer buffer = await ui.ImmutableBuffer .fromAsset (asset);
11
11
final ui.Codec codec = await PaintingBinding .instance.instantiateImageCodecWithSize (buffer);
12
12
final ui.FrameInfo frameInfo = await codec.getNextFrame ();
13
+ codec.dispose ();
13
14
return frameInfo.image;
14
15
}
15
16
Original file line number Diff line number Diff line change @@ -238,7 +238,9 @@ Future<ui.Image> _loadImage() async {
238
238
);
239
239
final ui.ImageDescriptor descriptor = await ui.ImageDescriptor .encoded (buffer);
240
240
final ui.Codec codec = await descriptor.instantiateCodec ();
241
- return (await codec.getNextFrame ()).image;
241
+ final ui.FrameInfo frameInfo = await codec.getNextFrame ();
242
+ codec.dispose ();
243
+ return frameInfo.image;
242
244
}
243
245
244
246
class MyHomePage extends StatefulWidget {
You can’t perform that action at this time.
0 commit comments