mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Fixing potential crash in dialog popups
This commit is contained in:
parent
cea57a111b
commit
5f38c5265c
1 changed files with 6 additions and 5 deletions
|
@ -150,7 +150,9 @@ protected:
|
|||
}
|
||||
|
||||
~ModalDialogListener() {
|
||||
disconnect(_dialog);
|
||||
if (_dialog) {
|
||||
disconnect(_dialog);
|
||||
}
|
||||
}
|
||||
|
||||
virtual QVariant waitForResult() {
|
||||
|
@ -164,10 +166,11 @@ protected slots:
|
|||
void onDestroyed() {
|
||||
_finished = true;
|
||||
disconnect(_dialog);
|
||||
_dialog = nullptr;
|
||||
}
|
||||
|
||||
protected:
|
||||
QQuickItem* const _dialog;
|
||||
QQuickItem* _dialog;
|
||||
bool _finished { false };
|
||||
QVariant _result;
|
||||
};
|
||||
|
@ -372,6 +375,7 @@ void OffscreenUi::createDesktop(const QUrl& url) {
|
|||
qDebug() << "Desktop already created";
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
getRootContext()->setContextProperty("DebugQML", QVariant(true));
|
||||
#else
|
||||
|
@ -382,9 +386,6 @@ void OffscreenUi::createDesktop(const QUrl& url) {
|
|||
Q_ASSERT(_desktop);
|
||||
getRootContext()->setContextProperty("desktop", _desktop);
|
||||
|
||||
// Enable focus debugging
|
||||
_desktop->setProperty("offscreenWindow", QVariant::fromValue(getWindow()));
|
||||
|
||||
_toolWindow = _desktop->findChild<QQuickItem*>("ToolWindow");
|
||||
|
||||
new VrMenu(this);
|
||||
|
|
Loading…
Reference in a new issue