Skip to content

Commit 23a3a84

Browse files
authored
Merge pull request #268 from ktopley-apple/dispatch-sync-fixup-overlay
Fix warnings in DispatchQueue.sync() implementation when using a comp…
2 parents 6bbecba + 2f22de2 commit 23a3a84

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/swift/Queue.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,13 @@ public extension DispatchQueue {
216216
{
217217
var result: T?
218218
var error: Swift.Error?
219-
fn {
220-
do {
221-
result = try work()
222-
} catch let e {
223-
error = e
219+
withoutActuallyEscaping(work) { _work in
220+
fn {
221+
do {
222+
result = try _work()
223+
} catch let e {
224+
error = e
225+
}
224226
}
225227
}
226228
if let e = error {

0 commit comments

Comments
 (0)