core/menu: disconnect menu before unref when changed

This commit is contained in:
outfoxxed 2024-09-15 16:06:20 -07:00
parent 08966f91c5
commit c57ac4b1f2
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -71,8 +71,8 @@ void QsMenuOpener::setMenu(QsMenuHandle* menu) {
QObject::disconnect(this->mMenu, nullptr, this, nullptr);
if (this->mMenu->menu()) {
this->mMenu->menu()->unref();
QObject::disconnect(this->mMenu->menu(), nullptr, this, nullptr);
this->mMenu->menu()->unref();
}
this->mMenu->unrefHandle();