From 8e18adc70f4ea49eb1e20976220d79874228257d Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 20 Mar 2013 13:48:20 +0100 Subject: 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 Reviewed-by: Erik Verbruggen --- src/plugins/cppeditor/cppquickfixes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/cppeditor/cppquickfixes.cpp') 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 = interface->context().control(); + QSharedPointer 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(); -- cgit v1.2.1