summaryrefslogtreecommitdiff
path: root/src/plugins/cppeditor/cppquickfixes.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@me.com>2013-03-20 13:48:20 +0100
committerErik Verbruggen <erik.verbruggen@digia.com>2013-05-03 10:56:26 +0200
commit8e18adc70f4ea49eb1e20976220d79874228257d (patch)
treecbdc3f9876bae0610e6eb3282b6baf6c6300ef86 /src/plugins/cppeditor/cppquickfixes.cpp
parent6999e3c33907c0b4b09902f18dee0407c6d6293e (diff)
downloadqt-creator-8e18adc70f4ea49eb1e20976220d79874228257d.tar.gz
C++: Fix crash in code completion.
Caused by a dangling pointer of a template instantiation which had been cloned into the wrong control. The fix is to remove that control and refer to the control of the bindings (which is the correct one). Change-Id: I951a60f2e613aae1e4ac901ce99c820212018709 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfixes.cpp')
-rw-r--r--src/plugins/cppeditor/cppquickfixes.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/cppeditor/cppquickfixes.cpp b/src/plugins/cppeditor/cppquickfixes.cpp
index 5454753f3c..f9c04a1ad2 100644
--- a/src/plugins/cppeditor/cppquickfixes.cpp
+++ b/src/plugins/cppeditor/cppquickfixes.cpp
@@ -1069,7 +1069,7 @@ void TranslateStringLiteral::match(const CppQuickFixInterface &interface,
QString trContext;
- QSharedPointer<Control> control = interface->context().control();
+ QSharedPointer<Control> control = interface->context().bindings()->control();
const Name *trName = control->identifier("tr");
// Check whether we are in a method:
@@ -1471,7 +1471,7 @@ public:
UseMinimalNames q(con);
env.enter(&q);
- Control *control = assistInterface()->context().control().data();
+ Control *control = assistInterface()->context().bindings()->control().data();
FullySpecifiedType tn = rewriteType(result.first().type(), &env, control);
Overview oo = CppCodeStyleSettings::currentProjectCodeStyleOverview();