diff --git a/src/ui/buttons/HostButton.cpp b/src/ui/buttons/HostButton.cpp index 8e2222b..ad6dc7a 100644 --- a/src/ui/buttons/HostButton.cpp +++ b/src/ui/buttons/HostButton.cpp @@ -27,8 +27,10 @@ HostButton::HostButton(Widget* parent, const std::string &address): Button(paren m_host_status_icon = FA_POWER_OFF; } - if (auto scr = screen()) { - scr->perform_layout(); + if (ref_count() > 1) { + if (auto scr = screen()) { + scr->perform_layout(); + } } dec_ref();