We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6a3fc92 commit 30fb085Copy full SHA for 30fb085
1 file changed
Sources/Instruments/Timer/Timer.swift
@@ -38,6 +38,8 @@ public class Timer {
38
39
private var state: State = .notRunning
40
41
+ // MARK: -
42
+
43
private let interval: TimeInterval
44
private let repeats: Bool
45
private let queue: DispatchQueue?
@@ -69,6 +71,10 @@ public class Timer {
69
71
}
70
72
73
deinit {
74
+ if timer == nil {
75
+ return
76
+ }
77
78
// If the timer is suspended, calling cancel without resuming triggers a crash. This is
79
// documented here https://forums.developer.apple.com/thread/15902
80
timer?.setEventHandler { }
0 commit comments