GAsyncResult* res,
gpointer user_data) {
_W("OnResultReceived()");
+ auto* ptr = static_cast<std::weak_ptr<FdBroker>*>(user_data);
+ auto broker = ptr->lock();
+ if (broker == nullptr) {
+ _E("broker is nullptr");
+ return;
+ }
+
+ std::lock_guard<std::recursive_mutex> lock(broker->GetMutex());
+ if (broker->cancellable_ == nullptr) {
+ _E("Invalid context. Fdbroker(%p)", broker.get());
+ return;
+ }
+
+ IEventWatcher* watcher = broker->watcher_;
GDBusConnection* conn = reinterpret_cast<GDBusConnection*>(source_object);
GError* err = nullptr;
GDBusMessage* reply = g_dbus_connection_send_message_with_reply_finish(conn,
if (err) {
if (err->code == G_IO_ERROR_CANCELLED)
_E("IO error cancelled");
+ else
+ _E("Error(%s) occurs", err->message);
g_error_free(err);
} else {
_E("g_dbus_connection_send_message_with_reply_finish() is failed");
}
+ watcher->OnPortDisconnected();
return;
}
auto reply_ptr = std::unique_ptr<GDBusMessage, decltype(g_object_unref)*>(
reply, g_object_unref);
- auto* ptr = static_cast<std::weak_ptr<FdBroker>*>(user_data);
- auto broker = ptr->lock();
- if (broker == nullptr) {
- _E("broker is nullptr");
- return;
- }
-
- std::lock_guard<std::recursive_mutex> lock(broker->GetMutex());
- if (broker->cancellable_ == nullptr) {
- _E("Invalid context. Fdbroker(%p)", broker.get());
- return;
- }
-
- IEventWatcher* watcher = broker->watcher_;
if (g_dbus_message_to_gerror(reply, &err)) {
_E("Failed to send message. error(%s)", err->message);
g_error_free(err);