[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:
Maxwell Swadling
2015-01-06 03:36:54 +00:00
parent 1d2664d366
commit 7fc1ad679a

View File

@@ -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.