diff --git a/include/modules/dwl/window.hpp b/include/modules/dwl/window.hpp index 6b068360..43586399 100644 --- a/include/modules/dwl/window.hpp +++ b/include/modules/dwl/window.hpp @@ -14,7 +14,7 @@ namespace waybar::modules::dwl { class Window : public AAppIconLabel, public sigc::trackable { public: Window(const std::string &, const waybar::Bar &, const Json::Value &); - virtual ~Window() = default; + ~Window(); void handle_layout(const uint32_t layout); void handle_title(const char *title); diff --git a/src/modules/dwl/window.cpp b/src/modules/dwl/window.cpp index 4f8b0281..870d87e4 100644 --- a/src/modules/dwl/window.cpp +++ b/src/modules/dwl/window.cpp @@ -80,7 +80,7 @@ Window::Window(const std::string &id, const Bar &bar, const Json::Value &config) wl_registry_add_listener(registry, ®istry_listener_impl, this); wl_display_roundtrip(display); - if (!status_manager_) { + if (status_manager_ == nullptr) { spdlog::error("dwl_status_manager_v2 not advertised"); return; } @@ -91,6 +91,12 @@ Window::Window(const std::string &id, const Bar &bar, const Json::Value &config) zdwl_ipc_manager_v2_destroy(status_manager_); } +Window::~Window() { + if (output_status_ != nullptr) { + zdwl_ipc_output_v2_destroy(output_status_); + } +} + void Window::handle_title(const char *title) { title_ = title; } void Window::handle_appid(const char *appid) { appid_ = appid; }