From 3af1853260dafc43c992fc2357a3f3bace3bccaa Mon Sep 17 00:00:00 2001 From: Viktar Lukashonak Date: Tue, 6 Jun 2023 23:02:36 +0300 Subject: [PATCH 1/2] Tray module cause error g_bus_unwatch_name() Signed-off-by: Viktar Lukashonak --- src/modules/sni/host.cpp | 4 ---- src/modules/sni/watcher.cpp | 7 +------ 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/modules/sni/host.cpp b/src/modules/sni/host.cpp index 007862d..fff8e01 100644 --- a/src/modules/sni/host.cpp +++ b/src/modules/sni/host.cpp @@ -22,10 +22,6 @@ Host::~Host() { Gio::DBus::unwatch_name(bus_name_id_); bus_name_id_ = 0; } - if (watcher_id_ > 0) { - Gio::DBus::unwatch_name(watcher_id_); - watcher_id_ = 0; - } g_cancellable_cancel(cancellable_); g_clear_object(&cancellable_); g_clear_object(&watcher_); diff --git a/src/modules/sni/watcher.cpp b/src/modules/sni/watcher.cpp index 34bcef6..6881677 100644 --- a/src/modules/sni/watcher.cpp +++ b/src/modules/sni/watcher.cpp @@ -14,12 +14,7 @@ Watcher::Watcher() watcher_(sn_watcher_skeleton_new()) {} Watcher::~Watcher() { - if (hosts_ != nullptr) { - g_slist_free_full(hosts_, gfWatchFree); - hosts_ = nullptr; - } - - if (items_ != nullptr) { + if (items_ != nullptr) { g_slist_free_full(items_, gfWatchFree); items_ = nullptr; } From a9779c2aa2099249f3d329e3a2c226703c4b5577 Mon Sep 17 00:00:00 2001 From: Viktar Lukashonak Date: Tue, 6 Jun 2023 23:06:11 +0300 Subject: [PATCH 2/2] Happy Linter Signed-off-by: Viktar Lukashonak --- src/modules/sni/watcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/sni/watcher.cpp b/src/modules/sni/watcher.cpp index 6881677..663fdcd 100644 --- a/src/modules/sni/watcher.cpp +++ b/src/modules/sni/watcher.cpp @@ -14,7 +14,7 @@ Watcher::Watcher() watcher_(sn_watcher_skeleton_new()) {} Watcher::~Watcher() { - if (items_ != nullptr) { + if (items_ != nullptr) { g_slist_free_full(items_, gfWatchFree); items_ = nullptr; }