Commit 00dac575 authored by con's avatar con

Don't delete members in DebuggerPlugin::shutdown.

Do it in the destructor instead.

Reviewed-by: hjk
parent ec5fe88b
......@@ -342,6 +342,19 @@ DebuggerManager::DebuggerManager(DebuggerPlugin *plugin)
DebuggerManager::~DebuggerManager()
{
#define doDelete(ptr) delete ptr; ptr = 0
doDelete(scriptEngine);
doDelete(pdbEngine);
doDelete(gdbEngine);
doDelete(cdbEngine);
doDelete(d->m_breakHandler);
doDelete(d->m_threadsHandler);
doDelete(d->m_modulesHandler);
doDelete(d->m_registerHandler);
doDelete(d->m_snapshotHandler);
doDelete(d->m_stackHandler);
doDelete(d->m_watchHandler);
doDelete(gdbEngine);
doDelete(scriptEngine);
doDelete(cdbEngine);
......@@ -847,34 +860,6 @@ void DebuggerManager::shutdown()
if (d->m_engine)
d->m_engine->shutdown();
d->m_engine = 0;
#define doDelete(ptr) delete ptr; ptr = 0
doDelete(scriptEngine);
doDelete(pdbEngine);
doDelete(gdbEngine);
doDelete(cdbEngine);
// Delete these manually before deleting the manager
// (who will delete the models for most views)
doDelete(d->m_breakWindow);
doDelete(d->m_modulesWindow);
doDelete(d->m_outputWindow);
doDelete(d->m_registerWindow);
doDelete(d->m_stackWindow);
doDelete(d->m_sourceFilesWindow);
doDelete(d->m_threadsWindow);
//doDelete(d->m_tooltipWindow);
doDelete(d->m_watchersWindow);
doDelete(d->m_localsWindow);
doDelete(d->m_breakHandler);
doDelete(d->m_threadsHandler);
doDelete(d->m_modulesHandler);
doDelete(d->m_registerHandler);
doDelete(d->m_snapshotHandler);
doDelete(d->m_stackHandler);
doDelete(d->m_watchHandler);
#undef doDelete
}
void DebuggerManager::makeSnapshot()
......
......@@ -545,25 +545,11 @@ DebuggerPlugin::DebuggerPlugin()
{}
DebuggerPlugin::~DebuggerPlugin()
{}
void DebuggerPlugin::shutdown()
{
QTC_ASSERT(m_manager, /**/);
if (m_manager)
m_manager->shutdown();
writeSettings();
if (m_uiSwitcher)
m_uiSwitcher->shutdown();
delete DebuggerSettings::instance();
removeObject(m_debugMode);
// FIXME: when using the line below, BreakWindow etc gets deleted twice.
// so better leak for now...
delete m_debugMode;
m_debugMode = 0;
......@@ -579,6 +565,18 @@ void DebuggerPlugin::shutdown()
m_uiSwitcher = 0;
}
void DebuggerPlugin::shutdown()
{
QTC_ASSERT(m_manager, /**/);
if (m_manager)
m_manager->shutdown();
writeSettings();
if (m_uiSwitcher)
m_uiSwitcher->shutdown();
}
static QString msgParameterMissing(const QString &a)
{
return DebuggerPlugin::tr("Option '%1' is missing the parameter.").arg(a);
......
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