OSDN Git Service

gd: Unwind futures and promises in reverse time
authorChris Manton <cmanton@google.com>
Tue, 3 Nov 2020 00:37:28 +0000 (16:37 -0800)
committerChris Manton <cmanton@google.com>
Wed, 4 Nov 2020 18:30:05 +0000 (10:30 -0800)
Bug: 171568335
Tag: #refactor
Test: atest --host bluetooth_test_gd
Change-Id: I3ff1deb2c23388b8c2114b09689ddea7380f7365

gd/hci/acl_manager_test.cc

index 99cf066..3237fe5 100644 (file)
@@ -168,8 +168,8 @@ class TestHciLayer : public HciLayer {
 
   ConnectionManagementCommandView GetLastCommandPacket(OpCode op_code) {
     if (!command_queue_.empty() && command_future_ != nullptr) {
-      command_promise_.reset();
       command_future_.reset();
+      command_promise_.reset();
     } else if (command_future_ != nullptr) {
       auto result = command_future_->wait_for(std::chrono::milliseconds(1000));
       EXPECT_NE(std::future_status::timeout, result);