Commit 243a6259 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

EditorManager: Fix crash when closing an editor upon activation

* activateEditor receives a pointer to the editor.
* When currentEditorChanged is emitted (using a direct connection),
  closeEditor is called (because changes were reverted and the editor
  isn't needed anymore.
* closeEditor eventually deletes the editor
* Control is returned to activateEditor, which now references a deleted
  editor -> crash

Task-number: QTCREATORBUG-10190
Change-Id: I9062f03c1c1550f0a8c0c49c226dedcfd252eb12
Reviewed-by: default avatarTobias Hunger <>
Reviewed-by: default avatarPetar Perisin <>
parent 8b7dff6f
......@@ -1161,9 +1161,8 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask
emit editorsClosed(acceptedEditors);
foreach (IEditor *editor, acceptedEditors) {
delete editor;
foreach (IEditor *editor, acceptedEditors)
if (currentView) {
if (IEditor *editor = currentView->currentEditor())
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