Skip to content

Commit

Permalink
Merge pull request #1630 from shogo4405/feature/fix-background-crash-2
Browse files Browse the repository at this point in the history
Fixed crash when enter background.
  • Loading branch information
shogo4405 authored Nov 22, 2024
2 parents b17158f + a6f4a02 commit 0a3c549
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions HaishinKit/Sources/Mixer/MediaMixer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0a3c549

Please sign in to comment.