diff options
| author | 2019-09-30 18:10:53 +0000 | |
|---|---|---|
| committer | 2019-09-30 18:10:53 +0000 | |
| commit | 5491eb92fc9497c3688c0d2b13effd06c6f175e4 (patch) | |
| tree | cbeb4f25c78010e00f113d4b2b8e6ae5df819493 /tools/aapt2/Main.cpp | |
| parent | 20bdc266980131085996c026c1ecc17541652b43 (diff) | |
| parent | ac55e41f24df1bc5759eeb5fba8b6afbe6f71f04 (diff) | |
Merge "Fix memory leak in aapt2"
Diffstat (limited to 'tools/aapt2/Main.cpp')
| -rw-r--r-- | tools/aapt2/Main.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/aapt2/Main.cpp b/tools/aapt2/Main.cpp index 7966ba27ebd8..8a43bb4ede35 100644 --- a/tools/aapt2/Main.cpp +++ b/tools/aapt2/Main.cpp @@ -169,17 +169,12 @@ int MainImpl(int argc, char** argv) { aapt::text::Printer printer(&fout); aapt::StdErrDiagnostics diagnostics; - auto main_command = new aapt::MainCommand(&printer, &diagnostics); + aapt::MainCommand main_command(&printer, &diagnostics); // Add the daemon subcommand here so it cannot be called while executing the daemon - main_command->AddOptionalSubcommand( + main_command.AddOptionalSubcommand( aapt::util::make_unique<aapt::DaemonCommand>(&fout, &diagnostics)); - return main_command->Execute(args, &std::cerr); -} - -// TODO(b/141312058) stop leaks -extern "C" const char *__asan_default_options() { - return "detect_leaks=0"; + return main_command.Execute(args, &std::cerr); } int main(int argc, char** argv) { |