return NULL;
}
- LOGD("start");
+ LOGD("start - fd : %d", cb_info->fd);
single_msg = (char *)malloc(sizeof(char) * MUSE_CAMERA_MSG_MAX_LENGTH);
if (!single_msg) {
LOGD("client cb exit - server connected %d", cb_info->is_server_connected);
if (!cb_info->is_server_connected) {
+ char *error_msg = NULL;
+
+ if (cb_info->fd < 0) {
+ LOGE("fd is closed in client side");
+ goto CB_HANDLER_EXIT;
+ }
+
/* send error msg for server disconnection */
- char *error_msg = muse_core_msg_new(MUSE_CAMERA_CB_EVENT,
+ error_msg = muse_core_msg_new(MUSE_CAMERA_CB_EVENT,
MUSE_TYPE_INT, "error", CAMERA_ERROR_SERVICE_DISCONNECTED,
MUSE_TYPE_INT, "current_state", CAMERA_STATE_NONE,
NULL);
if (pc) {
if (pc->cb_info) {
+ int temp_fd = pc->cb_info->fd;
+
+ /* pc->cb_info->fd should be closed,
+ because g_thread_join for msg_recv_thread is not returned
+ in _camera_client_callback_destroy. */
+ if (temp_fd > -1) {
+ pc->cb_info->fd = -1;
+ muse_client_close(temp_fd);
+ }
+
_camera_client_callback_destroy(pc->cb_info);
pc->cb_info = NULL;
}