From 7554be6ab2ed99f2ccc36832db727f47da8f46d2 Mon Sep 17 00:00:00 2001 From: Roman Laitarenko Date: Thu, 10 Oct 2024 14:43:53 +0300 Subject: [PATCH 1/2] Fix crash after creating/destroying multiple Snapshotters --- lib/src/snapshotter/snapshotter.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/snapshotter/snapshotter.dart b/lib/src/snapshotter/snapshotter.dart index 42ec384f6..605db3d03 100644 --- a/lib/src/snapshotter/snapshotter.dart +++ b/lib/src/snapshotter/snapshotter.dart @@ -79,7 +79,7 @@ final class Snapshotter { snapshotter._mapEvents.eventTypes.map((e) => e.index).toList(), options); - Snapshotter._finalizer.attach(snapshotter, snapshotter._suffix); + Snapshotter._finalizer.attach(snapshotter, snapshotter._suffix, detach: snapshotter); return snapshotter; } From 2102d9a9614df5022d148e01d0f7107846aa7c10 Mon Sep 17 00:00:00 2001 From: Roman Laitarenko Date: Thu, 10 Oct 2024 14:56:59 +0300 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 506f7fffa..9061cf840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ onCameraChangeListener(CameraChangedEventData data) { ``` * Print to console native Maps SDK logs in debug configuration. Logs are proxied only in debug configuration and can be disabled completely by passing environment flag `MAPBOX_LOG_DEBUG` with false value. +* Fix rare crash in `Snapshotter`. The crash could happen when creating/destroying multiple instances of `Snapshotter` in succession. # 2.3.0