Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f62b168 authored by Chris Manton's avatar Chris Manton
Browse files

gatt: Properly init/free gatt layer

Bug: 188073123
Test: gd/cert/run
Tag: #refactor

Change-Id: Ieb7356322153588dbc1ce3d2030222c5bb2954d2
parent 25fcbbae
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -167,8 +167,10 @@ void gatt_free(void) {
  }

  gatt_cb.hdl_list_info->clear();
  delete gatt_cb.hdl_list_info;
  gatt_cb.hdl_list_info = nullptr;
  gatt_cb.srv_list_info->clear();
  delete gatt_cb.srv_list_info;
  gatt_cb.srv_list_info = nullptr;

  EattExtension::GetInstance()->Stop();
+6 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@

#include "common/message_loop_thread.h"
#include "stack/gatt/gatt_int.h"
#include "stack/include/gatt_api.h"

std::map<std::string, int> mock_function_count_map;

@@ -78,3 +79,8 @@ TEST_F(StackGattTest, lifecycle_tGATT_REG) {
    delete reg0;
  }
}

TEST_F(StackGattTest, gatt_init) {
  gatt_init();
  gatt_free();
}