Skip to content

Commit 8a3a6e1

Browse files
committed
NimbleEnvironment should be NSObject because it will be stored in Thread.threadDictionary.
1 parent 6f47da1 commit 8a3a6e1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Sources/Nimble/Adapters/NimbleEnvironment.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Foundation
33

44
/// "Global" state of Nimble is stored here. Only DSL functions should access / be aware of this
55
/// class' existence
6-
internal class NimbleEnvironment {
6+
internal class NimbleEnvironment: NSObject {
77
static var activeInstance: NimbleEnvironment {
88
get {
99
let env = Thread.current.threadDictionary["NimbleEnvironment"]
@@ -30,11 +30,14 @@ internal class NimbleEnvironment {
3030
var suppressTVOSAssertionWarning: Bool = false
3131
var awaiter: Awaiter
3232

33-
init() {
33+
override init() {
3434
let timeoutQueue = DispatchQueue.global(qos: .userInitiated)
3535
awaiter = Awaiter(
3636
waitLock: AssertionWaitLock(),
3737
asyncQueue: .main,
38-
timeoutQueue: timeoutQueue)
38+
timeoutQueue: timeoutQueue
39+
)
40+
41+
super.init()
3942
}
4043
}

0 commit comments

Comments
 (0)