Skip to content

Commit 9070817

Browse files
committed
[gardening] Fix assign to a weak variable releasing immediately.
The compiler was warning about this assign to a weak variable, where the value was going to be released immediately. Modify the code to hold the value in a strong variable during the block to avoid the warning (and probably a failing test). This test is actually disabled, so nothing should change.
1 parent 2e6971e commit 9070817

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

TestFoundation/TestNotificationQueue.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,9 @@ FIXME SR-4280 timeouts in TestNSNotificationQueue tests
205205
weak var notificationQueue: NotificationQueue?
206206

207207
self.executeInBackgroundThread() {
208-
notificationQueue = NotificationQueue(notificationCenter: NotificationCenter())
209-
XCTAssertNotNil(notificationQueue)
208+
let nq = NotificationQueue(notificationCenter: NotificationCenter())
209+
notificationQueue = nq
210+
XCTAssertNotNil(nq)
210211
}
211212

212213
XCTAssertNil(notificationQueue)

0 commit comments

Comments
 (0)