Skip to content

Commit

Permalink
Fixes modifying state during view update (#63)
Browse files Browse the repository at this point in the history
* Fixes modifying state during view update

* Update CHANGELOG
  • Loading branch information
ianthetechie authored Dec 3, 2024
1 parent ba76be3 commit ae790f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Version 0.4.2 - 2024-12-03

### Fixed

- Fixes a race modifying state during view update in rare cases

## Version 0.4.1 - 2024-11-19

### Fixed
Expand Down
4 changes: 3 additions & 1 deletion Sources/MapLibreSwiftUI/MapViewCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ public class MapViewCoordinator<T: MapViewHostViewController>: NSObject, MLNMapV
direction: mapView.direction,
reason: CameraChangeReason(reason))
snapshotCamera = newCamera
parent.camera = newCamera
DispatchQueue.main.async {
self.parent.camera = newCamera
}
}

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

0 comments on commit ae790f0

Please sign in to comment.