summaryrefslogtreecommitdiff
path: root/src/Daemon/BoxDaemonImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Daemon/BoxDaemonImpl.cpp')
-rwxr-xr-xsrc/Daemon/BoxDaemonImpl.cpp90
1 files changed, 46 insertions, 44 deletions
diff --git a/src/Daemon/BoxDaemonImpl.cpp b/src/Daemon/BoxDaemonImpl.cpp
index 1d38bfc..c129269 100755
--- a/src/Daemon/BoxDaemonImpl.cpp
+++ b/src/Daemon/BoxDaemonImpl.cpp
@@ -147,10 +147,10 @@ int BoxDaemonImpl::boxCreateCallback(
LogD("update period: %d", info->period);
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_ADD_BOX, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_ADD_BOX, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::boxReCreateCallback(ProviderEventArgPtr arg, void* data)
@@ -189,10 +189,10 @@ int BoxDaemonImpl::boxReCreateCallback(ProviderEventArgPtr arg, void* data)
LogD("update period: %f", info->period);
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_ADD_BOX, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_ADD_BOX, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::boxDestroyCallback(ProviderEventArgPtr arg, void* data)
@@ -210,10 +210,10 @@ int BoxDaemonImpl::boxDestroyCallback(ProviderEventArgPtr arg, void* data)
LogD("InstanceId: %s", info->instanceId.c_str());
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_REMOVE_BOX, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_REMOVE_BOX, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::pdCreateCallback(ProviderEventArgPtr arg, void* data)
@@ -243,10 +243,10 @@ int BoxDaemonImpl::pdCreateCallback(ProviderEventArgPtr arg, void* data)
LogD("y: %f", info->pdY);
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_OPEN_PD, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_OPEN_PD, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::pdDestroyCallback(ProviderEventArgPtr arg, void* data)
@@ -264,10 +264,10 @@ int BoxDaemonImpl::pdDestroyCallback(ProviderEventArgPtr arg, void* data)
LogD("InstanceId: %s", info->instanceId.c_str());
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_CLOSE_PD, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_CLOSE_PD, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::clickedCallback(ProviderEventArgPtr arg, void* data)
@@ -313,10 +313,10 @@ int BoxDaemonImpl::resizeCallback(ProviderEventArgPtr arg, void* data)
LogD("height: %d", info->boxHeight);
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_RESIZE_BOX, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_RESIZE_BOX, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::boxPauseCallback(ProviderEventArgPtr arg, void* data)
@@ -335,10 +335,10 @@ int BoxDaemonImpl::boxPauseCallback(ProviderEventArgPtr arg, void* data)
LogD("InstanceId: %s", info->instanceId.c_str());
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_PAUSE_BOX, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_PAUSE_BOX, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::boxResumeCallback(ProviderEventArgPtr arg, void* data)
@@ -357,10 +357,10 @@ int BoxDaemonImpl::boxResumeCallback(ProviderEventArgPtr arg, void* data)
LogD("InstanceId: %s", info->instanceId.c_str());
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_RESUME_BOX, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_RESUME_BOX, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::pauseCallback(ProviderEventArgPtr arg, void* data)
@@ -373,10 +373,10 @@ int BoxDaemonImpl::pauseCallback(ProviderEventArgPtr arg, void* data)
LogD("web-provider is paused");
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_PAUSE_ALL, BoxInfoPtr(), This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_PAUSE_ALL, BoxInfoPtr(), This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::resumeCallback(ProviderEventArgPtr arg, void* data)
@@ -389,10 +389,10 @@ int BoxDaemonImpl::resumeCallback(ProviderEventArgPtr arg, void* data)
LogD("web-provider is resumed");
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_RESUME_ALL, BoxInfoPtr(), This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_RESUME_ALL, BoxInfoPtr(), This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
int BoxDaemonImpl::updateContentCallback(ProviderEventArgPtr arg, void* data)
@@ -418,10 +418,10 @@ int BoxDaemonImpl::changePeriodCallback(ProviderEventArgPtr arg, void* data)
LogD("period: %f", info->period);
LogD("--------------------------------------------");
- return ecore_job_add(
- requestBoxJobCallback,
- new JobInfo(REQUEST_CMD_CHANGE_PERIOD, info, This))
- ? 0 : -1;
+ JobInfo* jobInfo = new JobInfo(REQUEST_CMD_CHANGE_PERIOD, info, This);
+ Ecore_Job* ret = ecore_job_add(requestBoxJobCallback, jobInfo);
+
+ return ret ? 0 : -1;
}
void BoxDaemonImpl::setProviderCallbacks(ProviderCallbacks& callbacks)
@@ -518,4 +518,6 @@ void BoxDaemonImpl::requestBoxJobCallback(void* data)
// request box job!
jobInfo->daemonImpl->m_pluginConnector->requestCommand(
jobInfo->cmdType, jobInfo->boxInfo);
+
+ delete jobInfo;
}