forked from qt-creator/qt-creator
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 <christian.kandeler@qt.io>
This commit is contained in:
@@ -1170,6 +1170,7 @@ LinuxDevicePrivate::LinuxDevicePrivate(LinuxDevice *parent)
|
|||||||
|
|
||||||
LinuxDevicePrivate::~LinuxDevicePrivate()
|
LinuxDevicePrivate::~LinuxDevicePrivate()
|
||||||
{
|
{
|
||||||
|
QMutexLocker locker(&m_shellMutex);
|
||||||
auto closeShell = [this] {
|
auto closeShell = [this] {
|
||||||
m_shellThread.quit();
|
m_shellThread.quit();
|
||||||
m_shellThread.wait();
|
m_shellThread.wait();
|
||||||
|
|||||||
Reference in New Issue
Block a user