mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] fixed incorrect deinitialization in Dictionary
Dictionary could be double freed after bridging to ObjC due to a call to takeRetainedValue(), causing a segfault. This was fixed by removing the free call, as it was unnecessary. Fixes rdar://problem/18544533 Swift SVN r24208
This commit is contained in:
@@ -2319,11 +2319,7 @@ final internal class _Native${Self}StorageOwner<${TypeParametersDecl}>
|
||||
internal func deinitializeHeapBufferBridged() {
|
||||
// Perform a non-atomic store because storage should be
|
||||
// uniquely-referenced.
|
||||
let ptr = UnsafeMutablePointer<COpaquePointer>(_heapBufferBridgedPtr).memory
|
||||
if ptr != nil {
|
||||
Unmanaged<AnyObject>.fromOpaque(ptr).takeRetainedValue()
|
||||
_heapBufferBridgedPtr.memory = nil
|
||||
}
|
||||
_heapBufferBridgedPtr.memory = nil
|
||||
}
|
||||
|
||||
/// Returns the bridged ${Self} values.
|
||||
|
||||
Reference in New Issue
Block a user