#include <aul.h>
#include <aul_rpc_port.h>
#include <glib.h>
+#include <sys/types.h>
+#include <unistd.h>
#include <atomic>
#include <mutex>
auto p = static_cast<std::shared_ptr<::ProxyExt>*>(h);
auto* proxy = p->get();
_W("rpc_port_proxy_destroy(%p)", proxy);
+ if (getpid() == gettid()) {
+ delete p;
+ return RPC_PORT_ERROR_NONE;
+ }
+
proxy->SetDestroying(true);
proxy->DisconnectPort();
-
g_idle_add_full(G_PRIORITY_HIGH,
[](gpointer data) -> gboolean {
auto p = static_cast<std::shared_ptr<::ProxyExt>*>(data);
delete p;
return G_SOURCE_REMOVE;
}, h, nullptr);
+
return RPC_PORT_ERROR_NONE;
}
_W("rpc_port_stub_destroy(%p)", h);
auto p = static_cast<::StubExt*>(h);
aul_rpc_port_usr_destroy(p->GetPortName().c_str(), rpc_port_get_target_uid());
+ if (getpid() == gettid()) {
+ delete p;
+ return RPC_PORT_ERROR_NONE;
+ }
+
p->Ignore();
p->SetDestroying(true);
-
g_idle_add_full(G_PRIORITY_HIGH,
[](gpointer data) -> gboolean {
auto p = static_cast<::StubExt*>(data);
delete p;
return G_SOURCE_REMOVE;
}, h, nullptr);
+
return RPC_PORT_ERROR_NONE;
}