forked from qt-creator/qt-creator
Clang: Stop sending data to backend on disconnect
This addresses
SOFT ASSERT made fatal: "m_connection.isConnected()" in file
src/plugins/clangcodemodel/clangbackendipcintegration.cpp, line 230
I could not reproduce the issue locally, so I'm leaving the soft asserts
untouched for now.
Change-Id: If1d55ba7bc7e2d1ac20ad992c6d0d43ceb0f5d73
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -313,11 +313,16 @@ IpcCommunicator::IpcCommunicator()
|
||||
connect(Core::EditorManager::instance(), &Core::EditorManager::editorAboutToClose,
|
||||
this, &IpcCommunicator::onEditorAboutToClose);
|
||||
connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose,
|
||||
this, &IpcCommunicator::onCoreAboutToClose);
|
||||
this, &IpcCommunicator::setupDummySender);
|
||||
|
||||
initializeBackend();
|
||||
}
|
||||
|
||||
IpcCommunicator::~IpcCommunicator()
|
||||
{
|
||||
disconnect(&m_connection, 0, this, 0);
|
||||
}
|
||||
|
||||
void IpcCommunicator::initializeBackend()
|
||||
{
|
||||
const QString clangBackEndProcessPath = backendProcessPath();
|
||||
@@ -329,6 +334,8 @@ void IpcCommunicator::initializeBackend()
|
||||
|
||||
connect(&m_connection, &ConnectionClient::connectedToLocalSocket,
|
||||
this, &IpcCommunicator::onConnectedToBackend);
|
||||
connect(&m_connection, &ConnectionClient::disconnectedFromLocalSocket,
|
||||
this, &IpcCommunicator::setupDummySender);
|
||||
|
||||
m_connection.startProcessAndConnectToServerAsynchronously();
|
||||
}
|
||||
@@ -633,7 +640,7 @@ void IpcCommunicator::onEditorAboutToClose(Core::IEditor *editor)
|
||||
m_ipcReceiver.deleteProcessorsOfEditorWidget(textEditor->editorWidget());
|
||||
}
|
||||
|
||||
void IpcCommunicator::onCoreAboutToClose()
|
||||
void IpcCommunicator::setupDummySender()
|
||||
{
|
||||
m_ipcSender.reset(new DummyIpcSender);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user