forked from qt-creator/qt-creator
		
	Revert "EditorManager: Fix crash when closing an editor upon activation"
Deleting an editor while currentEditorChanged is apparently not a good idea. Use a queued connection instead. This reverts commits243a625961,447c4ed37f,d9602ca550and3103487038. Change-Id: Iccbee25fb77714963faa6f7184d1f5f53ed348a6 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
		
				
					committed by
					
						
						Orgad Shaneh
					
				
			
			
				
	
			
			
			
						parent
						
							171fd691c3
						
					
				
				
					commit
					f47c101b8b
				
			@@ -33,7 +33,7 @@
 | 
			
		||||
#include "modelmanagertesthelper.h"
 | 
			
		||||
 | 
			
		||||
#include <coreplugin/editormanager/editormanager.h>
 | 
			
		||||
#include <coreplugin/plugintestutils.h>
 | 
			
		||||
#include <coreplugin/testdatadir.h>
 | 
			
		||||
#include <projectexplorer/projectexplorer.h>
 | 
			
		||||
#include <projectexplorer/session.h>
 | 
			
		||||
#include <utils/hostosinfo.h>
 | 
			
		||||
@@ -62,7 +62,7 @@ namespace {
 | 
			
		||||
 | 
			
		||||
inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); }
 | 
			
		||||
 | 
			
		||||
class MyTestDataDir : public Core::Tests::TestDataDir
 | 
			
		||||
class MyTestDataDir : public Core::Internal::Tests::TestDataDir
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    MyTestDataDir(const QString &dir)
 | 
			
		||||
@@ -723,7 +723,7 @@ void CppToolsPlugin::test_modelmanager_gc_if_last_cppeditor_closed()
 | 
			
		||||
    helper.waitForRefreshedSourceFiles();
 | 
			
		||||
 | 
			
		||||
    // Close file/editor
 | 
			
		||||
    Core::Tests::closeAndDeleteEditor(editor);
 | 
			
		||||
    Core::EditorManager::closeEditor(editor, /*askAboutModifiedEditors=*/ false);
 | 
			
		||||
    helper.waitForFinishedGc();
 | 
			
		||||
 | 
			
		||||
    // Check: File is removed from the snapshpt
 | 
			
		||||
@@ -760,7 +760,7 @@ void CppToolsPlugin::test_modelmanager_dont_gc_opened_files()
 | 
			
		||||
    QVERIFY(mm->snapshot().contains(file));
 | 
			
		||||
 | 
			
		||||
    // Close editor
 | 
			
		||||
    Core::Tests::closeAndDeleteEditor(editor);
 | 
			
		||||
    Core::EditorManager::closeEditor(editor);
 | 
			
		||||
    helper.waitForFinishedGc();
 | 
			
		||||
    QVERIFY(mm->snapshot().isEmpty());
 | 
			
		||||
}
 | 
			
		||||
@@ -772,7 +772,7 @@ struct EditorCloser {
 | 
			
		||||
    ~EditorCloser()
 | 
			
		||||
    {
 | 
			
		||||
        if (editor)
 | 
			
		||||
            Core::Tests::closeAndDeleteEditor(editor);
 | 
			
		||||
            Core::EditorManager::closeEditor(editor);
 | 
			
		||||
    }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user