From c7aae25b94ebf6b2950ff6a585dbc3a5d03f24ea Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 1 Aug 2024 07:33:06 +0200 Subject: [PATCH] RemoteLinux: Fix crash When adding a Docker device via the Add Device Wizard, while the docker executable is running on a remote linux device, a crash would happen because the linux device is destroyed due to a call to "saveSettings". This patch adds a lock to the device shell mutex during destruction to try and keep the device alive while a LinuxDevicePrivate::runInShell call is still ongoing. Fixes: QTCREATORBUG-31364 Change-Id: Ia154b527bb8344fc41fa91a56a7ef3305bfef0fa Reviewed-by: Christian Kandeler --- src/plugins/remotelinux/linuxdevice.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/remotelinux/linuxdevice.cpp b/src/plugins/remotelinux/linuxdevice.cpp index c4b21a1f413..e539d9733d0 100644 --- a/src/plugins/remotelinux/linuxdevice.cpp +++ b/src/plugins/remotelinux/linuxdevice.cpp @@ -1170,6 +1170,7 @@ LinuxDevicePrivate::LinuxDevicePrivate(LinuxDevice *parent) LinuxDevicePrivate::~LinuxDevicePrivate() { + QMutexLocker locker(&m_shellMutex); auto closeShell = [this] { m_shellThread.quit(); m_shellThread.wait();