Skip to content

Commit ae790f0

Browse files
authored
Fixes modifying state during view update (maplibre#63)
* Fixes modifying state during view update * Update CHANGELOG
1 parent ba76be3 commit ae790f0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## Version 0.4.2 - 2024-12-03
9+
10+
### Fixed
11+
12+
- Fixes a race modifying state during view update in rare cases
13+
814
## Version 0.4.1 - 2024-11-19
915

1016
### Fixed

Sources/MapLibreSwiftUI/MapViewCoordinator.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,9 @@ public class MapViewCoordinator<T: MapViewHostViewController>: NSObject, MLNMapV
357357
direction: mapView.direction,
358358
reason: CameraChangeReason(reason))
359359
snapshotCamera = newCamera
360-
parent.camera = newCamera
360+
DispatchQueue.main.async {
361+
self.parent.camera = newCamera
362+
}
361363
}
362364

363365
/// The MapView's region has changed with a specific reason.

0 commit comments

Comments
 (0)