Initialize voidedata with new operation 57/145357/1
authorsungwook79.park <sungwook79.park@samsung.com>
Tue, 22 Aug 2017 06:23:23 +0000 (15:23 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Tue, 22 Aug 2017 06:23:23 +0000 (15:23 +0900)
Change-Id: Ic191278ffd51bb6d2119e5a6eddcb8475352a037
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/w-input-stt-ise.cpp
src/w-input-stt-voice.cpp

index 3dab87d..db786c4 100755 (executable)
@@ -44,7 +44,7 @@ void show_voice_input(Evas_Object *parent, const char *lang, void (*get_string)(
        //stt_feedback_initialize();
 
        if (!my_voicedata) {
-               my_voicedata = (VoiceData*)malloc(sizeof(VoiceData));
+               my_voicedata = new VoiceData;
                if (my_voicedata == NULL) {
                        PRINTFUNC(DLOG_ERROR, "%d::::Heap Overflow, Voice Input cannot be shown!", __LINE__);
                        return;
index d39c87c..fb0c086 100755 (executable)
@@ -1800,7 +1800,7 @@ int init_voicedata(VoiceData *r_voicedata)
        voicedata->guide_text_timer = NULL;
        voicedata->btn_disabling_timer = NULL;
        voicedata->power_unlock_timer = NULL;
-
+       voicedata->stt_results.clear();
        voicedata->partial_result = NULL;
        voicedata->result_type = 0;
        voicedata->disclaimer = 1;
@@ -2040,7 +2040,7 @@ void on_destroy(VoiceData *r_voicedata)
                        voicedata->sttfeedback = NULL;
                }
 
-               free(voicedata);
+               delete voicedata;
        }
 }