X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=client%2Ftts_client.c;h=4ce1855f7790677f8dc66ded094796cf2a428387;hb=c3fa9b4a5913fdb9a587769219297544c71cb821;hp=0a76de58ff823ff2101bca840e5495f8e6aab4c4;hpb=321c0e26716c44630c993044c656f8e13958487a;p=platform%2Fcore%2Fuifw%2Ftts.git diff --git a/client/tts_client.c b/client/tts_client.c index 0a76de5..4ce1855 100644 --- a/client/tts_client.c +++ b/client/tts_client.c @@ -77,8 +77,18 @@ int tts_client_new(tts_h* tts) client->cb_ref_count = 0; + client->utt_id = 0; + client->reason = 0; + client->err_msg = NULL; + client->conn_timer = NULL; + client->credential = NULL; + client->credential_needed = false; + client->internal = false; + + client->text_repeat = NULL; + g_client_list = g_list_append(g_client_list, client); *tts = temp; @@ -93,7 +103,7 @@ int tts_client_destroy(tts_h tts) if (tts == NULL) { SLOG(LOG_ERROR, TAG_TTSC, "Input parameter is NULL"); return TTS_ERROR_INVALID_PARAMETER; - } + } GList *iter = NULL; tts_client_s *data = NULL; @@ -111,9 +121,28 @@ int tts_client_destroy(tts_h tts) while (0 != data->cb_ref_count) { /* wait for release callback function */ } + + if (NULL != data->err_msg) { + free(data->err_msg); + data->err_msg = NULL; + } + + if (NULL != data->credential) { + free(data->credential); + data->credential = NULL; + } + + if (NULL != data->text_repeat) { + free(data->text_repeat); + data->text_repeat = NULL; + } + free(data); free(tts); + data = NULL; + tts = NULL; + SLOG(LOG_DEBUG, TAG_TTSC, "Client destroy"); g_list_free(iter); @@ -260,4 +289,4 @@ int tts_client_get_mode_client_count(tts_mode_e mode) GList* tts_client_get_client_list() { return g_client_list; -} \ No newline at end of file +}