Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

Swift Client: Fix double deallocation #3668

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion native_client/swift/deepspeech_ios/DeepSpeech.swift
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ public class DeepSpeechStream {
precondition(streamCtx != nil, "calling method on invalidated Stream")

let result = DS_FinishStreamWithMetadata(streamCtx, UInt32(numResults))!
defer { DS_FreeMetadata(result) }
defer {
DS_FreeMetadata(result)
streamCtx = nil
}
return DeepSpeechMetadata(fromInternal: result)
}
}
Expand Down