}
FdBroker::~FdBroker() {
+ Cancel();
+}
+
+void FdBroker::Cancel() {
+ LOGI("FdBroker::Cancel!");
+
if (cancellable_) {
LOGW("Cancel the send request");
g_cancellable_cancel(cancellable_);
g_object_unref(cancellable_);
+ cancellable_ = nullptr;
}
- if (watcher_id_ > 0)
+ if (watcher_id_ > 0) {
g_bus_unwatch_name(watcher_id_);
+ watcher_id_ = 0;
+ }
if (registration_id_ > 0) {
g_dbus_connection_unregister_object(
DBusConnectionManager::GetInst().GetConnection(),
registration_id_);
+ registration_id_ = 0;
}
if (mock_) {
DBusConnectionManager::GetInst().Dispose();
}
+ void Cancel();
int Send(const std::string& target_appid, const std::string& port_name,
int (*fds)[2]);
int Listen(IEventListener* ev, const std::string& port_name);
if (obj->listener_) {
IEventListener* listener = obj->listener_;
obj->listener_ = nullptr;
+ obj->fd_broker_.Cancel();
listener->OnRejected(obj->target_appid_);
}