forked from qt-creator/qt-creator
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:
@@ -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();
|
||||
|
Reference in New Issue
Block a user