From 090967c21d90f004994a9b84be4c145f6d4076cf Mon Sep 17 00:00:00 2001 From: Magesh K <47920326+mahee96@users.noreply.github.com> Date: Thu, 28 Nov 2024 18:36:17 +0530 Subject: [PATCH] - Fix: refresh(): app was being accessed after de-alloc causing EXC_BREAKPOINT --- AltStore/Managing Apps/AppManager.swift | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/AltStore/Managing Apps/AppManager.swift b/AltStore/Managing Apps/AppManager.swift index 4acca372..2bd51bec 100644 --- a/AltStore/Managing Apps/AppManager.swift +++ b/AltStore/Managing Apps/AppManager.swift @@ -1468,16 +1468,15 @@ private extension AppManager let context = AppOperationContext(bundleIdentifier: app.bundleIdentifier, authenticatedContext: group.context) context.app = ALTApplication(fileURL: app.fileURL) - - let validateAppExtensionsOperation = RSTAsyncBlockOperation {(op) in + //App-Extensions: Ensure DB data and disk state must match + let dbAppEx: Set = Set(app.appExtensions) + let diskAppEx: Set = Set(context.app!.appExtensions) + let diskAppExNames = diskAppEx.map { $0.bundleIdentifier } + let dbAppExNames = dbAppEx.map{ $0.bundleIdentifier } + let isMatching = Set(dbAppExNames) == Set(diskAppExNames) + + let validateAppExtensionsOperation = RSTAsyncBlockOperation { op in - //App-Extensions: Ensure DB data and disk state must match - let dbAppEx: Set = app.appExtensions - let diskAppEx: Set = context.app!.appExtensions - let diskAppExNames = diskAppEx.map { $0.bundleIdentifier } - let dbAppExNames = dbAppEx.map{ $0.bundleIdentifier } - - let isMatching = Set(dbAppExNames) == Set(diskAppExNames) let errMessage = "AppManager.refresh: App Extensions in DB and Disk are matching: \(isMatching)\n" + "AppManager.refresh: dbAppEx: \(dbAppExNames); diskAppEx: \(String(describing: diskAppExNames))\n" print(errMessage)