Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions podcasts/ThreadSafeDictionary.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import PocketCastsUtils

class ThreadSafeDictionary<Key: Hashable, Value> {

private let queue: DispatchQueue
Expand All @@ -9,9 +11,9 @@ class ThreadSafeDictionary<Key: Hashable, Value> {

deinit {
//ensure that all work is done before releasing the table
queue.sync(flags: .barrier) { [weak self] in
queue.async(flags: .barrier) { [table] in
//Last work item
self?.table.removeAll()
FileLog.shared.console("Dealocating table with \(table.count) elements")
}
}

Expand Down