Merge pull request #1977 from Legion2/patch-1

fixed duplicate deallocation of stream in Swift STTStream
This commit is contained in:
Reuben Morais 2021-10-30 10:19:17 +02:00 committed by GitHub
commit 5f2ff85fe8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -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)
}
}