core/popupanchor: null check mItem in onItemWindowChanged

Also emit itemChanged in PopupAnchor::setItem().
This commit is contained in:
outfoxxed committed 2026-08-15 20:53:19 -07:00
1 parent 7e6c7ae3fb
commit 990a8badab
2 files changed
+4 -1

No files matched your search

+1
View File
@@ -18,3 +18,4 @@
- Fixed `ColorQuantizer` deletion crashing if an operation was live.
- Fixed crashes when failing to create a `ScreencopyView`.
- Fixed `PwNodePeakMonitor` crashing when sampling a stream with mismatched channels from the node.
- Fixed unsetting `PopupAnchor.item` causing a crash.
+3 -1
View File
@@ -93,6 +93,8 @@ void PopupAnchor::setItem(QQuickItem* item) {
QObject::connect(item, &QObject::destroyed, this, &PopupAnchor::onItemDestroyed);
QObject::connect(item, &QQuickItem::windowChanged, this, &PopupAnchor::onItemWindowChanged);
}
emit this->itemChanged();
}
void PopupAnchor::onWindowDestroyed() {
@@ -109,7 +111,7 @@ void PopupAnchor::onItemDestroyed() {
}
void PopupAnchor::onItemWindowChanged() {
if (auto* window = qobject_cast<ProxiedWindow*>(this->mItem->window())) {
if (auto* window = qobject_cast<ProxiedWindow*>(this->mItem ? this->mItem->window() : nullptr)) {
this->setWindowInternal(window->proxy());
} else {
this->setWindowInternal(nullptr);