Indenters: Fix dangling pointer when project settings are deleted.

Task-number: QTCREATORBUG-5390
Change-Id: I68517955a86fbb2ded53f6235a7fe27793e2b2c8
Reviewed-on: http://codereview.qt.nokia.com/1481
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
Christian Kamm
2011-07-12 08:52:32 +02:00
parent f7b2dd95de
commit 1dfd78a9c8
4 changed files with 33 additions and 1 deletions

View File

@@ -50,6 +50,8 @@ using namespace CppTools;
CppQtStyleIndenter::CppQtStyleIndenter()
: m_cppCodeStylePreferences(0)
{
// Just for safety. setCodeStylePreferences should be called when the editor the
// indenter belongs to gets initialized.
m_cppCodeStylePreferences = CppToolsSettings::instance()->cppCodeStylePreferences();
}