Fix segfault in destructor

This commit is contained in:
David Delarosa 2023-04-13 17:16:37 +03:00
parent 731eaeb0be
commit 1368ba64b5
1 changed files with 2 additions and 1 deletions

View File

@ -148,10 +148,11 @@ Tags::Tags(const std::string &id, const waybar::Bar &bar, const Json::Value &con
zdwl_output_v1_add_listener(output_status_, &output_status_listener_impl, this);
zdwl_manager_v1_destroy(status_manager_);
status_manager_ = nullptr;
}
Tags::~Tags() {
if (output_status_) {
if (status_manager_) {
zdwl_manager_v1_destroy(status_manager_);
}
}