Skip to content

Commit

Permalink
fix(Tray): Unexport on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexays committed Apr 19, 2019
1 parent cbb6f2a commit 8cf1982
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/modules/sni/watcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 3 additions & 4 deletions src/modules/sni/watcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Gio::DBus::Connection>& conn, Glib::ustring name) {
Expand All @@ -41,9 +40,9 @@ void Watcher::busAcquired(const Glib::RefPtr<Gio::DBus::Connection>& 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);
}

Expand Down

0 comments on commit 8cf1982

Please sign in to comment.