From a6f4a021b275e19afe10f55617f4ee51fb1c9cf8 Mon Sep 17 00:00:00 2001 From: shogo4405 Date: Fri, 22 Nov 2024 21:22:34 +0900 Subject: [PATCH] refs #1629 --- HaishinKit/Sources/Mixer/MediaMixer.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/HaishinKit/Sources/Mixer/MediaMixer.swift b/HaishinKit/Sources/Mixer/MediaMixer.swift index f6d00cf95..aea278cdb 100644 --- a/HaishinKit/Sources/Mixer/MediaMixer.swift +++ b/HaishinKit/Sources/Mixer/MediaMixer.swift @@ -384,16 +384,16 @@ extension MediaMixer: AsyncRunner { NotificationCenter .Publisher(center: .default, name: UIApplication.didEnterBackgroundNotification, object: nil) .sink { _ in - Task { - self.setBackgroundMode(true) + Task { @MainActor in + await self.setBackgroundMode(true) } } .store(in: &cancellables) NotificationCenter .Publisher(center: .default, name: UIApplication.willEnterForegroundNotification, object: nil) .sink { _ in - Task { - self.setBackgroundMode(false) + Task { @MainActor in + await self.setBackgroundMode(false) } } .store(in: &cancellables)