listener_ = ev;
target_appid_ = std::move(appid);
port_name_ = std::move(port_name);
+
+ if (conn_timer_)
+ g_source_remove(conn_timer_);
+ conn_timer_ = g_timeout_add(10 * 1000, DbusNameTimeout, this);
+
int r = fd_broker_.Watch(this, target_appid_, port_name_);
if (r < 0) {
+ g_source_remove(conn_timer_);
listener_ = nullptr;
if (r == -EILLEGALACCESS)
return RPC_PORT_ERROR_PERMISSION_DENIED;
return RPC_PORT_ERROR_IO_ERROR;
}
- if (conn_timer_)
- g_source_remove(conn_timer_);
- conn_timer_ = g_timeout_add(10 * 1000, DbusNameTimeout, this);
-
return RPC_PORT_ERROR_NONE;
}