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(AUL_SOCK_NOREPLY);
- if (ret != 0)
- _E("Failed to send leave request. error(%d)", ret);
-
return G_SOURCE_REMOVE;
}, connection, nullptr);