From f294f1045aec0d522b57c31712e06820c92371b3 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 7 Nov 2022 15:26:04 -0600 Subject: [PATCH] Limits quitting other AltStore processes to database migrations only Previously, AltStore would quit all other processes when first accessing the database no matter what. However, this unintentionally caused the widget extension to quit the main app after refreshing apps. Now, we only quit other AltStore processes if a database migration is required. This still prevents multiple AltStores with different database schemas from accessing database concurrently, but also allows extensions to access database without quitting main app. --- AltStoreCore/Model/DatabaseManager.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/AltStoreCore/Model/DatabaseManager.swift b/AltStoreCore/Model/DatabaseManager.swift index 7cbb9c78..2a4dd26e 100644 --- a/AltStoreCore/Model/DatabaseManager.swift +++ b/AltStoreCore/Model/DatabaseManager.swift @@ -53,7 +53,6 @@ public class DatabaseManager private let coordinatorQueue = OperationQueue() private var ignoreWillMigrateDatabaseNotification = false - private init() { self.persistentContainer = PersistentContainer(name: "AltStore", bundle: Bundle(for: DatabaseManager.self)) @@ -93,7 +92,6 @@ public extension DatabaseManager self.ignoreWillMigrateDatabaseNotification = true CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), .willMigrateDatabase, nil, nil, true) } - self.migrateDatabaseToAppGroupIfNeeded { (result) in switch result {