Allow session handler objects to be initialized without MainActor to inline session creation with async await incompatible code. Fixes a Main thread dispatch clash.
This commit is contained in:
parent
3af64af961
commit
cba4af9ce8
@ -25,12 +25,14 @@
|
||||
return MVMCoreActionUtility.fatalClassCheck(object: MVMCoreObject.sharedInstance()?.sessionHandler)
|
||||
}
|
||||
|
||||
public override init() {
|
||||
nonisolated public override init() {
|
||||
super.init()
|
||||
// Adds notifications for if the app entered the background/foreground.
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appEnteredBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appEnteredForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||
resetStartTime()
|
||||
|
||||
Task { @MainActor in
|
||||
// Adds notifications for if the app entered the background/foreground.
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appEnteredBackground), name: UIApplication.didEnterBackgroundNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(appEnteredForeground), name: UIApplication.willEnterForegroundNotification, object: nil)
|
||||
}
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user