/*
-* Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+* Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
/* initialize client data */
client->stt = temp;
- client->pid = getpid();
+ client->pid = getpid();
client->uid = temp->handle;
-
+
client->recognition_result_cb = NULL;
client->recognition_result_user_data = NULL;
client->state_changed_cb = NULL;
client->default_lang_changed_user_data = NULL;
client->current_engine_id = NULL;
+ client->credential = NULL;
client->silence_supported = false;
client->silence = STT_OPTION_SILENCE_DETECTION_AUTO;
client->data_count = 0;
client->msg = NULL;
+ client->reason = 0;
+ client->err_msg = NULL;
+
client->before_state = STT_STATE_CREATED;
client->current_state = STT_STATE_CREATED;
*stt = temp;
- return 0;
+ return 0;
}
int stt_client_destroy(stt_h stt)
if (stt->handle == data->stt->handle) {
g_client_list = g_list_remove_link(g_client_list, iter);
- while (0 != data->cb_ref_count)
- {
+ while (0 != data->cb_ref_count) {
/* wait for release callback function */
}
-
+
if (NULL != data->current_engine_id) {
free(data->current_engine_id);
}
+ if (NULL != data->err_msg) {
+ free(data->err_msg);
+ data->err_msg = NULL;
+ }
+
+ if (NULL != data->credential) {
+ free(data->credential);
+ data->credential = NULL;
+ }
+
free(data);
free(stt);
+ data = NULL;
+ stt = NULL;
return 0;
}
while (NULL != iter) {
data = iter->data;
if (NULL != data) {
- if (stt->handle == data->stt->handle)
+ if (stt->handle == data->stt->handle)
return data;
}
/* Next item */
GList* stt_client_get_client_list()
{
return g_client_list;
-}
\ No newline at end of file
+}