{
app_control_h app_control = (app_control_h)data;
- printf("timeout called\n");
- app_control_destroy(app_control);
alarm_cancel_all();
normal_exit(1);
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);
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;
}