From 9c5f25ccd1637728d6e79592279e4b38ecd32f59 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 9 May 2022 01:47:34 +0200 Subject: JNI Lifecycle Fix: Have AdapterStatusListener derive from JavaUplink/DBTNativeDownlink, resolving BTAdapter::removeAllStatusListener() and use shared_ptr_ref - AdapterStatusListener's native instance is now created at java object construction, etc .. same pattern like BTDevice .. - Java/Native object relation is inherently thread safe due to using use shared_ptr_ref --- trial/direct_bt/dbt_client00.hpp | 2 +- trial/direct_bt/dbt_client01.hpp | 2 +- trial/direct_bt/dbt_client_server1x.hpp | 2 +- trial/direct_bt/dbt_server00.hpp | 2 +- trial/direct_bt/dbt_server01.hpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'trial/direct_bt') diff --git a/trial/direct_bt/dbt_client00.hpp b/trial/direct_bt/dbt_client00.hpp index e0fe8145..36508f8a 100644 --- a/trial/direct_bt/dbt_client00.hpp +++ b/trial/direct_bt/dbt_client00.hpp @@ -222,7 +222,7 @@ class DBTClient00 : public DBTClientTest { dc.detach(); } - std::string toString() const override { + std::string toString() const noexcept override { return "Client MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } diff --git a/trial/direct_bt/dbt_client01.hpp b/trial/direct_bt/dbt_client01.hpp index 2f86976d..99e93b44 100644 --- a/trial/direct_bt/dbt_client01.hpp +++ b/trial/direct_bt/dbt_client01.hpp @@ -239,7 +239,7 @@ class DBTClient01 : public DBTClientTest { dc.detach(); } - std::string toString() const override { + std::string toString() const noexcept override { return "Client MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } diff --git a/trial/direct_bt/dbt_client_server1x.hpp b/trial/direct_bt/dbt_client_server1x.hpp index 9952042a..012d5234 100644 --- a/trial/direct_bt/dbt_client_server1x.hpp +++ b/trial/direct_bt/dbt_client_server1x.hpp @@ -131,7 +131,7 @@ class DBTClientServer1x { fprintf_td(stderr, "XXXXXX Client Ready: %s\n", device->toString(true).c_str()); } - std::string toString() const override { return "DBTClientServer1x::Client"; } + std::string toString() const noexcept override { return "DBTClientServer1x::Client"; } }; std::shared_ptr clientAdapterStatusListener = std::make_shared(*this); REQUIRE( true == client->getAdapter()->addStatusListener(clientAdapterStatusListener) ); diff --git a/trial/direct_bt/dbt_server00.hpp b/trial/direct_bt/dbt_server00.hpp index 67ce53f2..4bd990f7 100644 --- a/trial/direct_bt/dbt_server00.hpp +++ b/trial/direct_bt/dbt_server00.hpp @@ -297,7 +297,7 @@ class DBTServer00 : public DBTServerTest { (void)timestamp; } - std::string toString() const override { + std::string toString() const noexcept override { return "Server MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } diff --git a/trial/direct_bt/dbt_server01.hpp b/trial/direct_bt/dbt_server01.hpp index 7dfe07ed..1b652c50 100644 --- a/trial/direct_bt/dbt_server01.hpp +++ b/trial/direct_bt/dbt_server01.hpp @@ -301,7 +301,7 @@ class DBTServer01 : public DBTServerTest { (void)timestamp; } - std::string toString() const override { + std::string toString() const noexcept override { return "Server MyAdapterStatusListener[this "+to_hexstring(this)+"]"; } -- cgit v1.2.3