fix(Tray): Unexport on exit

pull/272/head
Alex 2019-04-19 17:03:46 +02:00
parent cbb6f2a307
commit 8cf19826aa
2 changed files with 3 additions and 6 deletions

View File

@ -38,8 +38,6 @@ class Watcher {
GSList * hosts_ = nullptr; GSList * hosts_ = nullptr;
GSList * items_ = nullptr; GSList * items_ = nullptr;
SnWatcher *watcher_ = nullptr; SnWatcher *watcher_ = nullptr;
gulong handler_item_id_;
gulong handler_host_id_;
}; };
} // namespace waybar::modules::SNI } // namespace waybar::modules::SNI

View File

@ -28,8 +28,7 @@ Watcher::~Watcher() {
g_slist_free_full(items_, gfWatchFree); g_slist_free_full(items_, gfWatchFree);
items_ = NULL; items_ = NULL;
} }
g_signal_handler_disconnect(watcher_, handler_host_id_); g_dbus_interface_skeleton_unexport(G_DBUS_INTERFACE_SKELETON(watcher_));
g_signal_handler_disconnect(watcher_, handler_item_id_);
} }
void Watcher::busAcquired(const Glib::RefPtr<Gio::DBus::Connection>& conn, Glib::ustring name) { void Watcher::busAcquired(const Glib::RefPtr<Gio::DBus::Connection>& conn, Glib::ustring name) {
@ -41,9 +40,9 @@ void Watcher::busAcquired(const Glib::RefPtr<Gio::DBus::Connection>& conn, Glib:
g_error_free(error); g_error_free(error);
return; return;
} }
handler_item_id_ = g_signal_connect_swapped( g_signal_connect_swapped(
watcher_, "handle-register-item", G_CALLBACK(&Watcher::handleRegisterItem), this); 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); watcher_, "handle-register-host", G_CALLBACK(&Watcher::handleRegisterHost), this);
} }