mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-15 20:10:30 +00:00
fix race condition
This commit is contained in:
parent
abf7b73f4d
commit
22225d69af
1 changed files with 2 additions and 1 deletions
|
|
@ -10,6 +10,7 @@ import UIKit
|
|||
// Not AppStore
|
||||
class AppStoreIconFetcher {
|
||||
static private var iconCache: [String: UIImage] = [:]
|
||||
static private let iconFetchDispatchQueue = DispatchQueue(label: "com.stik.StikJIT.iconFetchQueue", attributes: .concurrent)
|
||||
|
||||
static func getIcon(for bundleID: String, completion: @escaping (UIImage?) -> Void) {
|
||||
// Check cache first
|
||||
|
|
@ -18,7 +19,7 @@ class AppStoreIconFetcher {
|
|||
return
|
||||
}
|
||||
|
||||
Task {
|
||||
iconFetchDispatchQueue.sync {
|
||||
do {
|
||||
let ans = try JITEnableContext.shared.getAppIcon(withBundleId: bundleID)
|
||||
iconCache[bundleID] = ans
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue