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

...on shutdown.

Now the slot will be disconnected on destruction.

Change-Id: Ie511bf5400c41eee3245879ea355293e7bb5c7cd
Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
This commit is contained in:
Nikolai Kosjar
2015-07-14 10:15:52 +02:00
parent 231aeafd1d
commit 83d1aa0d72
2 changed files with 8 additions and 4 deletions

View File

@@ -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();