Fixed a leak of ASTStructExtractors and also

made sure we don't keep around no-longer-valid
ASTTransformers.

<rdar://problem/15182379>

llvm-svn: 192333
This commit is contained in:
Sean Callanan
2013-10-10 00:39:23 +00:00
parent 762df1f139
commit 394e36dc81
3 changed files with 8 additions and 10 deletions

View File

@@ -95,15 +95,9 @@ ClangUserExpression::~ClangUserExpression ()
clang::ASTConsumer *
ClangUserExpression::ASTTransformer (clang::ASTConsumer *passthrough)
{
ClangASTContext *clang_ast_context = m_target->GetScratchClangASTContext();
if (!clang_ast_context)
return NULL;
if (!m_result_synthesizer.get())
m_result_synthesizer.reset(new ASTResultSynthesizer(passthrough,
*m_target));
{
m_result_synthesizer.reset(new ASTResultSynthesizer(passthrough,
*m_target));
return m_result_synthesizer.get();
}