diff options
author | Sven Gothel <[email protected]> | 2020-10-19 13:21:08 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-19 13:21:08 +0200 |
commit | e84963b9bb7bd383dd7f8bbb08b261d247b0332f (patch) | |
tree | c0814937f9a5dd8f3aa53736ee81a5fcde3fa498 /examples | |
parent | 75b1bb70467e68ed4f98cf2d9f177b28cc868379 (diff) |
DBTDevice::dtor: Don't recurse back into remove() -> adapter removeDevice(), that is how it potentially has been deleted!
This fix also gives us the opportunity back to use a simple mutex for mtx_sharedDevices.
Also add dedicated close() for better leak testing.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/direct_bt_scanner10/dbt_scanner10.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp index 49195865..aceebf37 100644 --- a/examples/direct_bt_scanner10/dbt_scanner10.cpp +++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp @@ -554,7 +554,10 @@ void test(int dev_id) { std::this_thread::sleep_for(std::chrono::milliseconds(3000)); } } - fprintf(stderr, "****** EOL Adapter's Devices\n"); + fprintf(stderr, "****** EOL Adapter's Devices - pre close\n"); + adapter.printSharedPtrListOfDevices(); + adapter.close(); + fprintf(stderr, "****** EOL Adapter's Devices - post close\n"); adapter.printSharedPtrListOfDevices(); } |