From d9f26079228207d680aa8c5955c0345e839a6246 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Wed, 12 Jun 2024 17:51:32 -0700 Subject: [PATCH] Capture self weakly in PostponingBlock. --- Core/Sources/Core/PostponingBlock.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Sources/Core/PostponingBlock.swift b/Core/Sources/Core/PostponingBlock.swift index 428be788c..04119a048 100644 --- a/Core/Sources/Core/PostponingBlock.swift +++ b/Core/Sources/Core/PostponingBlock.swift @@ -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() } } }