Merge pull request #1977 from Legion2/patch-1
fixed duplicate deallocation of stream in Swift STTStream
This commit is contained in:
commit
5f2ff85fe8
|
@ -283,7 +283,10 @@ public class STTStream {
|
|||
precondition(streamCtx != nil, "calling method on invalidated Stream")
|
||||
|
||||
let result = STT_FinishStreamWithMetadata(streamCtx, UInt32(numResults))!
|
||||
defer { STT_FreeMetadata(result) }
|
||||
defer {
|
||||
STT_FreeMetadata(result)
|
||||
streamCtx = nil
|
||||
}
|
||||
return STTMetadata(fromInternal: result)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue