Capture self weakly in PostponingBlock.

This commit is contained in:
Brent Simmons 2024-06-12 17:51:32 -07:00
parent a91fd53100
commit d9f2607922

View File

@ -32,9 +32,9 @@ import os
invalidateTimer()
timer = Timer.scheduledTimer(withTimeInterval: delayInterval, repeats: false) { timer in
timer = Timer.scheduledTimer(withTimeInterval: delayInterval, repeats: false) { [weak self] timer in
MainActor.assumeIsolated {
self.block()
self?.block()
}
}
}