Commit 83d1aa0d authored by Nikolai Kosjar's avatar Nikolai Kosjar

Clang: Avoid heap-use-after-free in IpcCommunicator

...on shutdown.

Now the slot will be disconnected on destruction.

Change-Id: Ie511bf5400c41eee3245879ea355293e7bb5c7cd
Reviewed-by: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
parent 231aeafd
......@@ -223,10 +223,8 @@ IpcCommunicator::IpcCommunicator()
connect(Core::EditorManager::instance(), &Core::EditorManager::editorAboutToClose,
this, &IpcCommunicator::onEditorAboutToClose);
connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose, [this]() {
m_sendMode = IgnoreSendRequests;
});
connect(Core::ICore::instance(), &Core::ICore::coreAboutToClose,
this, &IpcCommunicator::onCoreAboutToClose);
initializeBackend();
}
......@@ -376,6 +374,11 @@ void IpcCommunicator::onEditorAboutToClose(Core::IEditor *editor)
m_ipcReceiver.deleteProcessorsOfEditorWidget(textEditor->editorWidget());
}
void IpcCommunicator::onCoreAboutToClose()
{
m_sendMode = IgnoreSendRequests;
}
void IpcCommunicator::initializeBackendWithCurrentData()
{
registerEmptyProjectForProjectLessFiles();
......
......@@ -143,6 +143,7 @@ private:
void onBackendRestarted();
void onEditorAboutToClose(Core::IEditor *editor);
void onCoreAboutToClose();
IpcReceiver m_ipcReceiver;
ClangBackEnd::ConnectionClient m_connection;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment