Commit 2e1cad3b authored by hjk's avatar hjk
Browse files

debugger: fix crash on exit

Order matters.
parent 562d0c5f
...@@ -507,10 +507,14 @@ static DebuggerEngine *dummyEngine() ...@@ -507,10 +507,14 @@ static DebuggerEngine *dummyEngine()
class DebugMode : public IMode class DebugMode : public IMode
{ {
public: public:
DebugMode() : m_widget(0) { setObjectName(QLatin1String("DebugMode")); } DebugMode() : m_widget(0) { setObjectName(QLatin1String("DebugMode")); }
// Make sure the editor manager does not get deleted. ~DebugMode()
~DebugMode() { EditorManager::instance()->setParent(0); } {
// Make sure the editor manager does not get deleted.
//EditorManager::instance()->setParent(0);
delete m_widget;
}
// IMode // IMode
QString displayName() const { return DebuggerPlugin::tr("Debug"); } QString displayName() const { return DebuggerPlugin::tr("Debug"); }
...@@ -1420,16 +1424,16 @@ DebuggerPluginPrivate::~DebuggerPluginPrivate() ...@@ -1420,16 +1424,16 @@ DebuggerPluginPrivate::~DebuggerPluginPrivate()
delete m_debuggerSettings; delete m_debuggerSettings;
m_debuggerSettings = 0; m_debuggerSettings = 0;
m_plugin->removeObject(theDebuggerCore->m_debugMode);
delete m_debugMode;
m_debugMode = 0;
m_plugin->removeObject(m_mainWindow); m_plugin->removeObject(m_mainWindow);
delete m_mainWindow; delete m_mainWindow;
m_mainWindow = 0; m_mainWindow = 0;
delete m_snapshotHandler; delete m_snapshotHandler;
m_snapshotHandler = 0; m_snapshotHandler = 0;
m_plugin->removeObject(theDebuggerCore->m_debugMode);
delete m_debugMode;
m_debugMode = 0;
} }
DebuggerCore *debuggerCore() DebuggerCore *debuggerCore()
...@@ -1451,7 +1455,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, ...@@ -1451,7 +1455,7 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
// Cpp/Qml ui setup // Cpp/Qml ui setup
m_mainWindow = new DebuggerMainWindow; m_mainWindow = new DebuggerMainWindow;
ExtensionSystem::PluginManager::instance()->addObject(m_mainWindow); m_plugin->addObject(m_mainWindow);
return true; return true;
} }
......
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