From af5fe78f830d4b4ec902a45deb25d26963e69ba7 Mon Sep 17 00:00:00 2001 From: AZero13 Date: Thu, 11 Dec 2025 10:22:09 -0500 Subject: [PATCH] Deinitialize all the keys instead of just the first one --- Sources/Foundation/NSCFDictionary.swift | 2 +- Sources/Foundation/NSCFSet.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Foundation/NSCFDictionary.swift b/Sources/Foundation/NSCFDictionary.swift index 4d7269f588..46358baca8 100644 --- a/Sources/Foundation/NSCFDictionary.swift +++ b/Sources/Foundation/NSCFDictionary.swift @@ -71,7 +71,7 @@ internal final class _NSCFDictionary : NSMutableDictionary { let key = unsafeBitCast(keys.advanced(by: idx).pointee!, to: NSObject.self) keyArray.append(key) } - keys.deinitialize(count: 1) + keys.deinitialize(count: count) keys.deallocate() } } diff --git a/Sources/Foundation/NSCFSet.swift b/Sources/Foundation/NSCFSet.swift index 6b90fd71d7..19cf4fbfd3 100644 --- a/Sources/Foundation/NSCFSet.swift +++ b/Sources/Foundation/NSCFSet.swift @@ -58,7 +58,7 @@ internal final class _NSCFSet : NSMutableSet { let obj = unsafeBitCast(objects.advanced(by: idx).pointee!, to: AnyObject.self) objArray.append(obj) } - objects.deinitialize(count: 1) + objects.deinitialize(count: count) objects.deallocate() return NSGeneratorEnumerator(objArray.makeIterator())