File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -3887,6 +3887,8 @@ func checkGetObjectsAndKeys(
3887
3887
values. deinitialize ( count: storageSize) // noop
3888
3888
values. deallocate ( )
3889
3889
withExtendedLifetime ( canary) { }
3890
+ // [NSArray getObjects] does not retain the objects, so keep the dictionary alive.
3891
+ withExtendedLifetime ( dictionary) { }
3890
3892
}
3891
3893
3892
3894
DictionaryTestSuite . test ( " BridgedToObjC.Verbatim.getObjects:andKeys:count: " ) {
@@ -5080,6 +5082,8 @@ DictionaryTestSuite.test("getObjects:andKeys:count:") {
5080
5082
d. available_getObjects ( vp, andKeys: kp, count: 2 )
5081
5083
expectEqual ( expectedKeys, Array ( keys) )
5082
5084
expectEqual ( expectedValues, Array ( values) )
5085
+ // [NSArray getObjects] does not retain the objects, so keep the dictionary alive.
5086
+ withExtendedLifetime ( d) { }
5083
5087
}
5084
5088
#endif
5085
5089
You can’t perform that action at this time.
0 commit comments