valgrind clean

This commit is contained in:
Emil Lerch 2025-09-16 16:11:09 -07:00
parent f32e4401c8
commit 520eeeb99e
Signed by: lobo
GPG key ID: A7B62D657EF764F8

View file

@ -955,6 +955,9 @@ pub const SttSession = struct {
self.parseVoskResult(result_str) catch |err| {
self.options.event_handler.onError(err, "Failed to parse Vosk result");
};
// Reset recognizer after getting final result to clear internal buffers
c.vosk_recognizer_reset(self.vosk_recognizer);
}
} else if (accept_result == 0) {
// Partial result available (optional - for real-time feedback)
@ -1286,6 +1289,9 @@ pub const SttSession = struct {
// Free processing buffer
self.allocator.free(self.processing_buffer);
// Clean up ALSA global configuration cache
_ = c.snd_config_update_free_global();
// Mark as uninitialized
self.initialized = false;
}