Commit 8161acac authored by dt's avatar dt
Browse files

Fix crash introduced by actualy freeing memory.

Reviewed-By: con
parent 6c14c86f
......@@ -385,8 +385,7 @@ QtVersion::QtVersion(const QString &name, const QString &path)
QtVersion::~QtVersion()
{
delete m_toolChain;
m_toolChain = 0;
}
QString QtVersion::name() const
......@@ -853,7 +852,7 @@ void QtVersion::updateQMakeCXX() const
ProjectExplorer::ToolChain *QtVersion::toolChain() const
{
updateToolChain();
return m_toolChain;
return m_toolChain.data();
}
void QtVersion::updateToolChain() const
......@@ -893,11 +892,10 @@ void QtVersion::updateToolChain() const
qDebug()<<"Qt Creator doesn't know about the system includes, nor the systems defines.";
}
if (ProjectExplorer::ToolChain::equals(m_test, m_toolChain)) {
if (ProjectExplorer::ToolChain::equals(m_test, m_toolChain.data())) {
delete m_test;
} else {
delete m_toolChain;
m_toolChain = m_test;
m_toolChain = QSharedPointer<ProjectExplorer::ToolChain>(m_test);
}
m_toolChainUpToDate = true;
......
......@@ -33,6 +33,7 @@
#include <projectexplorer/environment.h>
#include <projectexplorer/toolchain.h>
#include <QtCore/QSharedPointer>
#include <QtCore/QHash>
namespace Qt4ProjectManager {
......@@ -154,7 +155,7 @@ private:
mutable QString m_qmakeCXX;
mutable bool m_toolChainUpToDate;
mutable ProjectExplorer::ToolChain *m_toolChain;
mutable QSharedPointer<ProjectExplorer::ToolChain> m_toolChain;
};
class QtVersionManager : public QObject
......
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