We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26280b3 commit 2d05c7aCopy full SHA for 2d05c7a
src/core/qsmenuanchor.cpp
@@ -78,8 +78,17 @@ void QsMenuAnchor::onClosed() {
78
this->platformMenu = nullptr;
79
}
80
81
- QObject::disconnect(this->mMenu, &QsMenuHandle::menuChanged, this, &QsMenuAnchor::onMenuChanged);
82
- this->mMenu->unrefHandle();
+ if (this->mMenu) {
+ QObject::disconnect(
83
+ this->mMenu,
84
+ &QsMenuHandle::menuChanged,
85
+ this,
86
+ &QsMenuAnchor::onMenuChanged
87
+ );
88
+
89
+ this->mMenu->unrefHandle();
90
+ }
91
92
emit this->closed();
93
emit this->visibleChanged();
94
@@ -109,6 +118,7 @@ bool QsMenuAnchor::isVisible() const { return this->mOpen; }
109
118
110
119
void QsMenuAnchor::onMenuDestroyed() {
111
120
this->mMenu = nullptr;
121
+ this->onClosed();
112
122
emit this->menuChanged();
113
123
114
124
0 commit comments