Keep the Control around for as long needed.

This commit is contained in:
Roberto Raggi
2010-06-04 17:58:29 +02:00
parent a56fd7b9f4
commit cceaffca5b
5 changed files with 32 additions and 22 deletions

View File

@@ -363,7 +363,7 @@ FullySpecifiedType ApplySubstitution::applySubstitution(int index) const
} // end of anonymous namespace
DeprecatedGenTemplateInstance::DeprecatedGenTemplateInstance(Control *control, const Substitution &substitution)
DeprecatedGenTemplateInstance::DeprecatedGenTemplateInstance(QSharedPointer<Control> control, const Substitution &substitution)
: _symbol(0),
_control(control),
_substitution(substitution)
@@ -371,11 +371,12 @@ DeprecatedGenTemplateInstance::DeprecatedGenTemplateInstance(Control *control, c
FullySpecifiedType DeprecatedGenTemplateInstance::gen(Symbol *symbol)
{
ApplySubstitution o(_control, symbol, _substitution);
ApplySubstitution o(_control.data(), symbol, _substitution);
return o.apply(symbol->type());
}
FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *className, Symbol *candidate, Control *control)
FullySpecifiedType DeprecatedGenTemplateInstance::instantiate(const Name *className, Symbol *candidate,
QSharedPointer<Control> control)
{
if (className) {
if (const TemplateNameId *templId = className->asTemplateNameId()) {