Delete timer handle for service state changed notification 74/280674/4
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 2 Sep 2022 05:05:40 +0000 (14:05 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 3 Nov 2022 04:44:27 +0000 (13:44 +0900)
- Issue:
The timer handle for service state changed notification is not deleted
if ttsd_finalize() is invoked before that the timer is handled.

- Solution:
This patch makes ttsd_finalize() delete the timer handle. And also, the
memory which stores the state change information should be deleted with
deleting the timer, because the memory is allocated for this timer
behavior.

Change-Id: I7a429c8ab5fb89237ba38c2b1c44c9d606ef01dd
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_server.c

index 4dbfc955377887d0b2155099fd9ba7597d7ccf2d..3602a18f948558a80e506452f993fe10d8850988 100644 (file)
@@ -664,6 +664,14 @@ int ttsd_finalize()
                }
        }
 
+       if (g_notify_state_timer) {
+               void* data = ecore_timer_del(g_notify_state_timer);
+               g_notify_state_timer = NULL;
+
+               free(data);
+               SLOG(LOG_INFO, tts_tag(), "[INFO] Delete ecore notify state timer handle");
+       }
+
        if (g_wait_timer) {
                ecore_timer_del(g_wait_timer);
                g_wait_timer = NULL;