From: Hannah von Reth Date: Wed, 18 Mar 2020 15:07:50 +0000 (+0100) Subject: [SocketApi] Ensure listener still exists X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~468^2~124 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=12ae1e97c624273f626b4570795ede2da3632754;p=nextcloud-desktop.git [SocketApi] Ensure listener still exists --- diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp index f64e44d33..e453271bf 100644 --- a/src/gui/socketapi.cpp +++ b/src/gui/socketapi.cpp @@ -388,8 +388,10 @@ void SocketApi::slotReadSocket() } } else { if (indexOfMethod != -1) { + // to ensure that listener is still valid we need to call it with Qt::DirectConnection + ASSERT(thread() == QThread::currentThread()) staticMetaObject.method(indexOfMethod) - .invoke(this, Qt::QueuedConnection, Q_ARG(QString, argument), + .invoke(this, Qt::DirectConnection, Q_ARG(QString, argument), Q_ARG(SocketListener *, listener)); } else { qCWarning(lcSocketApi) << "The command is not supported by this version of the client:" << command << "with argument:" << argument;