Fix the callback issue in c# 45/155445/2
authorMinje Ahn <minje.ahn@samsung.com>
Fri, 13 Oct 2017 06:43:22 +0000 (15:43 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Fri, 13 Oct 2017 06:51:39 +0000 (15:51 +0900)
Change-Id: I3211fb921b9d120a5f69082a5b784a881dd92c2a
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
lib/media-util-register.c
packaging/media-server.spec

index 2f93eff..cc21d7b 100755 (executable)
@@ -80,6 +80,7 @@ gboolean _read_socket(GIOChannel *src, GIOCondition condition, gpointer data)
        char *sock_path = NULL;
        int recv_msg_size = 0;
        media_scan_data *req_data = NULL;
+       bool flag = false;
 
        sockfd = g_io_channel_unix_get_fd(src);
        if (sockfd < 0) {
@@ -147,9 +148,6 @@ gboolean _read_socket(GIOChannel *src, GIOCondition condition, gpointer data)
                                        MSAPI_DBG("FIND REQUEST [%s]", req_data->req_path);
                                        g_array_remove_index(req_list, i);
 
-                                       /*call user define function*/
-                                       req_data->cb_data->user_callback(&req_result, user_data);
-
                                        /*close an IO channel*/
                                        g_io_channel_shutdown(src, FALSE, NULL);
                                        g_io_channel_unref(src);
@@ -163,6 +161,7 @@ gboolean _read_socket(GIOChannel *src, GIOCondition condition, gpointer data)
                                        }
 
                                        MSAPI_DBG("REMOVE OK");
+                                       flag = true;
 
                                        break;
                                }
@@ -175,6 +174,10 @@ gboolean _read_socket(GIOChannel *src, GIOCondition condition, gpointer data)
                user_callback(&req_result, user_data);
        }
 
+       /*call user define function*/
+       if (flag)
+               user_callback(&req_result, user_data);
+
        MS_SAFE_FREE(req_result.complete_path);
 
        return TRUE;
index dbbdd12..d426d57 100755 (executable)
@@ -1,6 +1,6 @@
 Name:       media-server
 Summary:    A server for media content management
-Version:    0.3.56
+Version:    0.3.57
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0