Android: Fix memory leak

Delete the toolchain instance if not used

Change-Id: I213f11d6f5e9ab3ffa98641d0a774a19e11849b3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Vikas Pachdha
2018-05-08 12:02:32 +02:00
parent 768f0a6209
commit 02c7e76762

View File

@@ -471,8 +471,9 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath,
tc = new AndroidToolChain(abi, version, lang, tc = new AndroidToolChain(abi, version, lang,
ToolChain::AutoDetection); ToolChain::AutoDetection);
tc->resetToolChain(compilerPath); tc->resetToolChain(compilerPath);
QTC_ASSERT(!tc->originalTargetTriple().isEmpty(),
delete tc; continue);
} }
QTC_ASSERT(!tc->originalTargetTriple().isEmpty(), continue);
result.append(tc); result.append(tc);
toolChainBundle.append(tc); toolChainBundle.append(tc);
} }