[UTC][capi-appfw-alarm][non-ACR][Fix a tc issue] 56/210056/1
authorInkyun Kil <inkyun.kil@samsung.com>
Mon, 15 Jul 2019 09:12:00 +0000 (18:12 +0900)
committerInkyun Kil <inkyun.kil@samsung.com>
Mon, 15 Jul 2019 09:12:39 +0000 (18:12 +0900)
Change-Id: Ie0cec9bb47b0432aedaaa0e39142b634ebd1a54e
Signed-off-by: Inkyun Kil <inkyun.kil@samsung.com>
src/utc/alarm/utc_alarm.c

index adee02f112fb789792ea8d2e37c5176fe80fee95..02d5b5c4ebbcb96824a3233648f3050a0d2220ea 100755 (executable)
@@ -71,8 +71,6 @@ static gboolean timeout(gpointer data)
 {
        app_control_h app_control = (app_control_h)data;
 
-       printf("timeout called\n");
-       app_control_destroy(app_control);
        alarm_cancel_all();
        normal_exit(1);
 
@@ -81,14 +79,11 @@ static gboolean timeout(gpointer data)
 
 static bool foreach_alarm_cb(int alarm, void *user_data)
 {
-       app_control_h app_control = (app_control_h)user_data;
-
        if (timeout_id > 0) {
                g_source_remove(timeout_id);
                timeout_id = 0;
        }
 
-       app_control_destroy(app_control);
        alarm_cancel_all();
        normal_exit(0);
 
@@ -577,11 +572,12 @@ int utc_alarm_foreach_registered_alarm_p(void)
        assert_eq_with_exit(ret, APP_CONTROL_ERROR_NONE);
 
        alarm_schedule_after_delay(app_control, delay, period, &tid);
+       app_control_destroy(app_control);
 
-       ret = alarm_foreach_registered_alarm(foreach_alarm_cb, app_control);
+       ret = alarm_foreach_registered_alarm(foreach_alarm_cb, NULL);
        assert_eq_with_exit(ret, ALARM_ERROR_NONE);
 
-       timeout_id = g_timeout_add(5000, timeout, app_control);
+       timeout_id = g_timeout_add(5000, timeout, NULL);
 
        return 0;
 }