Skip to content

Commit 9d49470

Browse files
committed
cancel timer when stopping sync engine
1 parent 1165fb8 commit 9d49470

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/SQLiteData/CloudKit/SyncEngine.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@
423423
/// You must start the sync engine again using ``start()`` to synchronize the changes.
424424
public func stop() {
425425
guard isRunning else { return }
426+
previewTimerTask.withValue {
427+
$0?.cancel()
428+
$0 = nil
429+
}
426430
observationRegistrar.withMutation(of: self, keyPath: \.isRunning) {
427431
syncEngines.withValue {
428432
$0 = SyncEngines()

0 commit comments

Comments
 (0)