Fix async issue on RuntimeInfo class
authorJoohyun Kim <joohyune.kim@samsung.com>
Mon, 8 Jul 2013 05:28:27 +0000 (14:28 +0900)
committerJoohyun Kim <joohyune.kim@samsung.com>
Mon, 8 Jul 2013 05:40:11 +0000 (14:40 +0900)
Change-Id: I5982581a68093a06e5413c75c3facdb01149754d
Signed-off-by: Joohyun Kim <joohyune.kim@samsung.com>
src/system/FSys_RuntimeInfo.cpp

index 150fbc9..7290fc0 100644 (file)
@@ -192,6 +192,7 @@ _RuntimeInfo::GetDirectorySizeAsync(void* data)
        size = GetDirectorySize(dso->path);
 
 CATCH:
+       SysLog(NID_SYS, "pid: %d, id: %d, size: %lld, result: %s", dso->pid, dso->msg_id, size, GetErrorMessage(r));
        SendResponse(dso->pid, dso->msg_id, size, r);
        delete dso;
        return null;
@@ -204,7 +205,8 @@ _RuntimeInfo::SendResponse(int pid, int msg_id, long long size, result rcode)
        pthread_mutex_lock(&send_msg_lock);
 
        ArrayList* data = null;
-       String* value = null;
+       String* pValue = null;
+       String* pMessageId = null;
 
        SysLog(NID_SYS, "It sends asynchronous result.");
 
@@ -213,12 +215,17 @@ _RuntimeInfo::SendResponse(int pid, int msg_id, long long size, result rcode)
 
        data = new (std::nothrow) ArrayList(SingleObjectDeleter);
        data->Construct();
+
+       pMessageId = new (std::nothrow) String();
+       pMessageId->Append(msg_id);
+
        data->Add(new (std::nothrow) String(_RUNTIME_SERVICE_ID));
        data->Add(new (std::nothrow) String(_RUNTIME_GET_SIZE));
-       data->Add(new (std::nothrow) String(msg_id));
-       value = new (std::nothrow) String();
-       value->Append(size);
-       data->Add(value);
+       data->Add(pMessageId);
+
+       pValue = new (std::nothrow) String();
+       pValue->Append(size);
+       data->Add(pValue);
 
        if(rcode == E_SUCCESS)
        {