You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use CancellableNetworkTileProvider from the plugin. Frequently, when requests are cancelled, an unhandled Exception: Buffer parameter must not be null is shown in the console.
I haven't found where this exception comes from, but I think I've found the root cause:
_CNTPImageProvider uses an ImmutableBuffer that has been disposed:
Here, an ImmutableBuffer is created from TileProvider.transparentImage once, and then cached in tileProvider._cancelledImage for the whole lifetime of the TileProvider.
However, during the decode call, this buffer is disposed by sky_engine:
What is the bug?
I use
CancellableNetworkTileProvider
from the plugin. Frequently, when requests are cancelled, an unhandledException: Buffer parameter must not be null
is shown in the console.I haven't found where this exception comes from, but I think I've found the root cause:
_CNTPImageProvider
uses anImmutableBuffer
that has been disposed:https://github.com/fleaflet/flutter_map_cancellable_tile_provider/blob/dac6a1dddab0bdfda34049331ff6c2aee3379c64/lib/flutter_map_cancellable_tile_provider.dart#L147
Here, an
ImmutableBuffer
is created fromTileProvider.transparentImage
once, and then cached intileProvider._cancelledImage
for the whole lifetime of theTileProvider
.However, during the
decode
call, this buffer is disposed by sky_engine:https://github.com/flutter/engine/blob/d379d53b8ab1f53244cce9fc6e9918bbdd18ecd6/lib/ui/painting.dart#L2317
How can we reproduce it?
https://github.com/fleaflet/flutter_map/blob/master/example/lib/pages/cancellable_tile_provider.dart
Do you have a potential solution?
Replacing
??=
with??
in the line linked above (therefore creating a newImmutableBuffer
on each cancelled request) seems to resolve the issue.Platforms
Android 12 (Samsung Galaxy M21)
Severity
Minimum: Allows normal functioning
The text was updated successfully, but these errors were encountered: