diff options
author | David Anderson <dvander@google.com> | 2018-09-04 14:32:54 -0700 |
---|---|---|
committer | David Anderson <dvander@google.com> | 2018-09-04 15:01:12 -0700 |
commit | 03de645aac4dac3b19900b3d30a29b2d10249ad6 (patch) | |
tree | 4a0e3816decf6cf0250684fc1ec6f8d588ce3cc4 /fastboot/fastboot.cpp | |
parent | 33dcdb808b7d60107d527c22815d586b51836836 (diff) |
fastbootd: Fix transport ownership.
This change moves Transport ownership back out of FastBootDriver.
Callers of set_transport must ensure that the previous transport is
destroyed. In addition, deleting a transport now ensures that it is
closed.
Bug: 78793464
Test: fastboot, fuzzy_fastboot works
Change-Id: I8f9ed2f7d5b09fd0820b2677d087a027378f26db
Diffstat (limited to 'fastboot/fastboot.cpp')
-rw-r--r-- | fastboot/fastboot.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 2887d3b5d..1aef567f2 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -1847,6 +1847,10 @@ int FastBootTool::Main(int argc, char* argv[]) { int status = fb_execute_queue() ? EXIT_FAILURE : EXIT_SUCCESS; fprintf(stderr, "Finished. Total time: %.3fs\n", (now() - start)); + + if (Transport* old_transport = fb.set_transport(nullptr)) { + delete old_transport; + } return status; } |