{
if (NULL != g_conn_listener) {
dbus_connection_close(g_conn_listener);
- dbus_connection_unref(g_conn_listener);
g_conn_listener = NULL;
}
if (NULL != g_conn_sender) {
dbus_connection_close(g_conn_sender);
- dbus_connection_unref(g_conn_sender);
g_conn_sender = NULL;
}
}
{
if (NULL != g_m_conn_listener) {
dbus_connection_close(g_m_conn_listener);
- dbus_connection_unref(g_m_conn_listener);
g_m_conn_listener = NULL;
}
if (NULL != g_m_conn_sender) {
dbus_connection_close(g_m_conn_sender);
- dbus_connection_unref(g_m_conn_sender);
g_m_conn_sender = NULL;
}
}
{
if (NULL != g_s_conn_listener) {
dbus_connection_close(g_s_conn_listener);
- dbus_connection_unref(g_s_conn_listener);
g_s_conn_listener = NULL;
}
if (NULL != g_s_conn_sender) {
dbus_connection_close(g_s_conn_sender);
- dbus_connection_unref(g_s_conn_sender);
g_s_conn_sender = NULL;
}
}
{
if (NULL != g_w_conn_listener) {
dbus_connection_close(g_w_conn_listener);
- dbus_connection_unref(g_w_conn_listener);
g_w_conn_listener = NULL;
}
if (NULL != g_w_conn_sender) {
dbus_connection_close(g_w_conn_sender);
- dbus_connection_unref(g_w_conn_sender);
g_w_conn_sender = NULL;
}
}
free(temp_text);
temp_text = NULL;
+ vc_cmd_destroy(temp_cmd);
+ temp_cmd = NULL;
+
ret = sqlite3_step(stmt);
if (SQLITE_DONE == ret)
break;
} else {
SLOG(LOG_WARN, vc_db_tag(), "[WARNING] Command type(%d) is NOT valid : request type(%d)", temp, type);
- vc_cmd_destroy((vc_cmd_h)temp_cmd);
+ vc_cmd_destroy(temp_cmd);
+ temp_cmd = NULL;
}
ret = sqlite3_step(stmt);
if (SQLITE_DONE == ret)
ret = vc_db_begin_transaction();
if (0 != ret) {
SLOG(LOG_ERROR, vc_json_tag(), "[ERROR] Fail to begin transaction for db");
+ free(temp_type);
+ free(prev_appid);
+ temp_type = NULL;
+ prev_appid = NULL;
return ret;
}
char* disp_null = NULL;
char* utt_null = NULL;
+ int ret = VCD_ERROR_NONE;
if (NULL == disp_text) {
disp_null = strdup("#NULL");
disp_text = disp_null;
if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) {
SLOG(LOG_ERROR, TAG_VCD, "[Dbus ERROR] Fail to Send");
- return VCD_ERROR_OPERATION_FAILED;
+ ret = VCD_ERROR_OPERATION_FAILED;
} else {
SLOG(LOG_DEBUG, TAG_VCD, "[Dbus] SUCCESS Send");
dbus_connection_flush(g_conn_sender);
utt_null = NULL;
}
- return 0;
+ return ret;
}
int vcdc_send_error_signal_to_manager(int manager_pid, int reason, char *err_msg)
dbus_connection_close(g_conn_listener);
dbus_connection_close(g_conn_sender);
- dbus_connection_unref(g_conn_listener);
- dbus_connection_unref(g_conn_sender);
-
g_conn_listener = NULL;
g_conn_sender = NULL;
if (top_priority == temp_cmd->priority) {
filtered_id[filtered_count] = result_id[i];
filtered_count++;
- } else if (top_priority < temp_cmd->priority) {
- continue;
- } else {
+ } else if (top_priority > temp_cmd->priority) {
filtered_id[0] = result_id[i];
filtered_count = 1;
top_priority = temp_cmd->priority;
}
+
+ vc_cmd_destroy((vc_cmd_h)temp_cmd);
+ temp_cmd = NULL;
}
}
if (0 != vc_cmd_list_add(vc_cmd_list, (vc_cmd_h)temp_cmd)) {
SLOG(LOG_DEBUG, TAG_VCD, "Fail to add command to list");
vc_cmd_destroy((vc_cmd_h)temp_cmd);
+ temp_cmd = NULL;
}
} else {
SLOG(LOG_WARN, TAG_VCD, "[Server WARNING] NOT found matached result(%d)", filtered_id[i]);
for (j = 0; j < g_list_length(g_proc_list); j++) {
iter = g_list_nth(g_proc_list, j);
if (NULL != iter) {
- if (client_list[i] == GPOINTER_TO_INT(iter->data)) {
- SLOG(LOG_DEBUG, TAG_VCD, "%s pid(%d) is running", type ? (type == 1) ? "Widget" : "Manager" : "Normal", client_list[i]);
+ if (*(client_list + i) == GPOINTER_TO_INT(iter->data)) {
+ SLOG(LOG_DEBUG, TAG_VCD, "%s pid(%d) is running", type ? (type == 1) ? "Widget" : "Manager" : "Normal", *(client_list + i));
exist = true;
break;
}
}
if (false == exist) {
- SLOG(LOG_ERROR, TAG_VCD, "%s pid(%d) should be removed", type ? (type == 1) ? "Widget" : "Manager" : "Normal", client_list[i]);
+ SLOG(LOG_ERROR, TAG_VCD, "%s pid(%d) should be removed", type ? (type == 1) ? "Widget" : "Manager" : "Normal", *(client_list + i));
if (VCD_CLIENT_TYPE_NORMAL == type)
- vcd_server_finalize(client_list[i]);
+ vcd_server_finalize(*(client_list + i));
else if (VCD_CLIENT_TYPE_WIDGET == type)
- vcd_server_widget_finalize(client_list[i]);
+ vcd_server_widget_finalize(*(client_list + i));
else
vcd_server_mgr_finalize(mgr_pid);
}