Skip to content

Commit

Permalink
Merge pull request Quick#1261 from Quick/fix_crash_in_asyncspec_when_…
Browse files Browse the repository at this point in the history
…using_teststate

Fix crash in AsyncSpec when using TestState
  • Loading branch information
younata authored Jan 17, 2024
2 parents dec60fe + ee9016d commit e84f6fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Quick/Async/AsyncSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ open class AsyncSpec: AsyncSpecBase {

private static func addInstanceMethod(for example: AsyncExample, classSelectorNames selectorNames: inout Set<String>) -> Selector {
let block: @convention(block) (AsyncSpec, @escaping () -> Void) -> Void = { spec, completionHandler in
spec.example = example
Task {
spec.example = example
await example.run()
completionHandler()
AsyncSpec.current = nil
completionHandler()
}
}
let implementation = imp_implementationWithBlock(block as Any)
Expand Down

0 comments on commit e84f6fe

Please sign in to comment.