mc_retvm_if(mc_client == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
+ /*Send Disconnection Msg to Server*/
+ ret = mc_ipc_send_message_to_server(MC_MSG_SERVER_DISCONNECTION, MC_PRIV_TYPE_CLIENT, MC_SERVER_DISCONNECTION_MSG);
+ if (ret != MEDIA_CONTROLLER_ERROR_NONE)
+ mc_error("Failed to mc_ipc_send_message_to_server [%d]", ret);
+
if (mc_client->dconn) {
ret = mc_ipc_unref_dbus_connection(mc_client->dconn, &mc_client->dref_count);
if (ret != MEDIA_CONTROLLER_ERROR_NONE)
ret = __mc_client_create(&mc_client);
if (ret != MEDIA_CONTROLLER_ERROR_NONE) {
mc_error("Failed __mc_server_create [%d]", ret);
+ __mc_client_destroy(mc_client);
return ret;
}
+ ret = mc_db_delete_client_address_from_client_list(mc_client->db_handle, mc_client->client_name);
+ if (ret != MEDIA_CONTROLLER_ERROR_NONE)
+ mc_error("mc_db_delete_client_address_from_client_list failed [%d]", ret);
+
ret = mc_db_insert_client_address_into_client_list(mc_client->db_handle, mc_client->client_name);
if (ret != MEDIA_CONTROLLER_ERROR_NONE) {
mc_error("fail mc_db_insert_server_address_into_table [%d]", ret);
if (ret != MEDIA_CONTROLLER_ERROR_NONE)
mc_error("fail mc_db_delete_client_address_from_client_list [%d]", ret);
- /*Send Disconnection Msg to Server*/
- ret = mc_ipc_send_message_to_server(MC_MSG_SERVER_DISCONNECTION, MC_PRIV_TYPE_CLIENT, MC_SERVER_DISCONNECTION_MSG);
- if (ret != MEDIA_CONTROLLER_ERROR_NONE)
- mc_error("Failed to mc_ipc_send_message_to_server [%d]", ret);
-
ret = __mc_client_destroy(mc_client);
mc_debug_fleave();
mc_retvm_if(mc_server == NULL, MEDIA_CONTROLLER_ERROR_INVALID_PARAMETER, "Handle is NULL");
+ /*Send Disconnection Msg to Server*/
+ ret = mc_ipc_send_message_to_server(MC_MSG_SERVER_DISCONNECTION, MC_PRIV_TYPE_SERVER, MC_SERVER_DISCONNECTION_MSG);
+ if (ret != MEDIA_CONTROLLER_ERROR_NONE)
+ mc_error("Failed to mc_ipc_send_message_to_server [%d]", ret);
+
if (mc_server->dconn) {
ret = mc_ipc_unref_dbus_connection(mc_server->dconn, &mc_server->dref_count);
if (ret != MEDIA_CONTROLLER_ERROR_NONE)
if (ret != MEDIA_CONTROLLER_ERROR_NONE)
mc_error("Error __mc_server_send_message [%d]", ret);
- /*Send Disconnection Msg to Server*/
- ret = mc_ipc_send_message_to_server(MC_MSG_SERVER_DISCONNECTION, MC_PRIV_TYPE_SERVER, MC_SERVER_DISCONNECTION_MSG);
- if (ret != MEDIA_CONTROLLER_ERROR_NONE)
- mc_error("Failed to mc_ipc_send_message_to_server [%d]", ret);
-
ret = __mc_server_destoy(mc_server);
if (ret != MEDIA_CONTROLLER_ERROR_NONE)
mc_error("fail __mc_server_destoy [%d]", ret);