From 8cf19826aa3ef3f133cc33cb157baed75fcb838a Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 19 Apr 2019 17:03:46 +0200 Subject: [PATCH] fix(Tray): Unexport on exit --- include/modules/sni/watcher.hpp | 2 -- src/modules/sni/watcher.cpp | 7 +++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/modules/sni/watcher.hpp b/include/modules/sni/watcher.hpp index f892730a..30a2115d 100644 --- a/include/modules/sni/watcher.hpp +++ b/include/modules/sni/watcher.hpp @@ -38,8 +38,6 @@ class Watcher { GSList * hosts_ = nullptr; GSList * items_ = nullptr; SnWatcher *watcher_ = nullptr; - gulong handler_item_id_; - gulong handler_host_id_; }; } // namespace waybar::modules::SNI diff --git a/src/modules/sni/watcher.cpp b/src/modules/sni/watcher.cpp index eb83a5af..366526fd 100644 --- a/src/modules/sni/watcher.cpp +++ b/src/modules/sni/watcher.cpp @@ -28,8 +28,7 @@ Watcher::~Watcher() { g_slist_free_full(items_, gfWatchFree); items_ = NULL; } - g_signal_handler_disconnect(watcher_, handler_host_id_); - g_signal_handler_disconnect(watcher_, handler_item_id_); + g_dbus_interface_skeleton_unexport(G_DBUS_INTERFACE_SKELETON(watcher_)); } void Watcher::busAcquired(const Glib::RefPtr& conn, Glib::ustring name) { @@ -41,9 +40,9 @@ void Watcher::busAcquired(const Glib::RefPtr& conn, Glib: g_error_free(error); return; } - handler_item_id_ = g_signal_connect_swapped( + g_signal_connect_swapped( watcher_, "handle-register-item", G_CALLBACK(&Watcher::handleRegisterItem), this); - handler_host_id_ = g_signal_connect_swapped( + g_signal_connect_swapped( watcher_, "handle-register-host", G_CALLBACK(&Watcher::handleRegisterHost), this); }