summaryrefslogtreecommitdiff
path: root/tools/aapt2/Main.cpp
diff options
context:
space:
mode:
author Ryan Mitchell <rtmitchell@google.com> 2019-09-30 13:11:51 -0700
committer android-build-merger <android-build-merger@google.com> 2019-09-30 13:11:51 -0700
commit4092468b679b5a9b24bc2e8af99748fc4530dbdf (patch)
treeec0384af5e94d3977350607d10fafa48f70b18fc /tools/aapt2/Main.cpp
parent1fae7704a54b7eb98f57a12aec4b67eff0254d64 (diff)
parentfe7f2febfff603d0c038a922affb66cde2784d4b (diff)
Merge "Fix memory leak in aapt2" am: 5491eb92fc am: f26f7a206f
am: fe7f2febff Change-Id: Idb437f74240502bf677cafca410be91bdc2fcf78
Diffstat (limited to 'tools/aapt2/Main.cpp')
-rw-r--r--tools/aapt2/Main.cpp11
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) {