diff --git a/src/widgets/helper/Button.cpp b/src/widgets/helper/Button.cpp index 12cada4b2..7ad648097 100644 --- a/src/widgets/helper/Button.cpp +++ b/src/widgets/helper/Button.cpp @@ -113,6 +113,9 @@ const QColor &Button::getBorderColor() const void Button::setMenu(std::unique_ptr menu) { + if (this->menu_) + this->menu_.release()->deleteLater(); + this->menu_ = std::move(menu); this->menu_->installEventFilter( diff --git a/src/widgets/splits/SplitHeader.cpp b/src/widgets/splits/SplitHeader.cpp index f4c65870c..869184a24 100644 --- a/src/widgets/splits/SplitHeader.cpp +++ b/src/widgets/splits/SplitHeader.cpp @@ -284,7 +284,7 @@ void SplitHeader::initializeLayout() // dropdown this->dropdownButton_ = makeWidget