fixed duplicate deallocation of stream
streamCtx must be unset after STT_FreeStream was called in STT_FinishStreamWithMetadata, else STT_FreeStream is called again on destruction of STTStream resulting in EXC_BAD_ACCESS errors
This commit is contained in:
parent
5691d4e053
commit
fab1bbad73
@ -283,7 +283,10 @@ public class STTStream {
|
|||||||
precondition(streamCtx != nil, "calling method on invalidated Stream")
|
precondition(streamCtx != nil, "calling method on invalidated Stream")
|
||||||
|
|
||||||
let result = STT_FinishStreamWithMetadata(streamCtx, UInt32(numResults))!
|
let result = STT_FinishStreamWithMetadata(streamCtx, UInt32(numResults))!
|
||||||
defer { STT_FreeMetadata(result) }
|
defer {
|
||||||
|
STT_FreeMetadata(result)
|
||||||
|
streamCtx = nil
|
||||||
|
}
|
||||||
return STTMetadata(fromInternal: result)
|
return STTMetadata(fromInternal: result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user