.With(std::move(b))
.SendSimply();
if (type != BUNDLE_TYPE_NONE) {
- b.Delete(AUL_K_COM_ENDPOINT);
- b.Add(AUL_K_COM_ENDPOINT, com_endpoint);
+ bundle_del(envelope, AUL_K_COM_ENDPOINT);
+ bundle_add_str(envelope, AUL_K_COM_ENDPOINT, com_endpoint.c_str());
}
return ret;
std::lock_guard<std::recursive_mutex> lock(context.GetMutex());
conn->Disable();
+ std::string endpoint = conn->GetEndpoint();
+ if (!context.ExistConnection(endpoint)) {
+ tizen_base::Bundle b { { AUL_K_COM_ENDPOINT, endpoint } };
+ int ret = AppRequest(APP_COM_LEAVE, getuid())
+ .With(std::move(b))
+ .SendSimply(AUL_SOCK_NOREPLY);
+ if (ret != 0)
+ _E("Failed to send leave request. error(%d)", ret);
+ }
+
g_idle_add_full(G_PRIORITY_HIGH, [](gpointer user_data) -> gboolean {
auto* conn = static_cast<AppComConnection*>(user_data);
std::lock_guard<std::recursive_mutex> lock(context.GetMutex());
- std::string endpoint = conn->GetEndpoint();
context.RemoveConnection(conn);
-
- if (context.ExistConnection(endpoint))
- return G_SOURCE_REMOVE;
-
- tizen_base::Bundle b { { AUL_K_COM_ENDPOINT, endpoint } };
- int ret = AppRequest(APP_COM_LEAVE, getuid())
- .With(std::move(b))
- .SendSimply();
- if (ret != 0)
- _E("Failed to send leave request. error(%d)", ret);
-
return G_SOURCE_REMOVE;
}, connection, nullptr);