OSDN Git Service

Move destructor after stack flag in main/shim/::Stack::Stop()
authorChris Manton <cmanton@google.com>
Wed, 7 Oct 2020 16:05:13 +0000 (09:05 -0700)
committerChris Manton <cmanton@google.com>
Fri, 9 Oct 2020 19:21:44 +0000 (19:21 +0000)
Legacy shim acl releases controller resources

Bug: 166280067
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Test: classic paired Bose SoundLink

Change-Id: I78ccd0d541f82bfec86180f2c2dd0521af651b6d

main/shim/stack.cc

index ec4498d..b50b234 100644 (file)
@@ -143,12 +143,12 @@ void Stack::Stop() {
   if (!common::InitFlags::GdCoreEnabled()) {
     bluetooth::shim::hci_on_shutting_down();
   }
-  ASSERT_LOG(is_running_, "%s Gd stack not running", __func__);
-  is_running_ = false;
-
   delete acl_;
   acl_ = nullptr;
 
+  ASSERT_LOG(is_running_, "%s Gd stack not running", __func__);
+  is_running_ = false;
+
   delete btm_;
   btm_ = nullptr;