From 0354e630431b9b3eeb3f7c7feacfd2dbeb7bcd5e Mon Sep 17 00:00:00 2001 From: turtledreams Date: Wed, 8 Oct 2025 00:17:51 +0900 Subject: [PATCH 1/2] mutex fix --- CHANGELOG.md | 3 +++ src/countly.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d06f931..8286588 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## X.X.X +- Mitigated a mutex issue that can happen during update loop. + ## 23.2.1 - Added manual session control via "Countly::enableManualSessionControl". When enabled, automatic session calls are ignored, while manual calls remain usable for finer control. - Added "checkRQSize" function to return the current number of requests in the queue. diff --git a/src/countly.cpp b/src/countly.cpp index 4e32d7e..e5b321a 100644 --- a/src/countly.cpp +++ b/src/countly.cpp @@ -373,6 +373,7 @@ void Countly::start(const std::string &app_key, const std::string &host, int por #ifdef COUNTLY_USE_SQLITE if (configuration->databasePath == "" || configuration->databasePath == " ") { log(LogLevel::ERROR, "[Countly][start] Database path can not be empty or blank."); + mutex->unlock(); return; } #endif @@ -806,7 +807,8 @@ bool Countly::updateSession() { void Countly::packEvents() { try { - // events array + mutex->lock(); + // events array nlohmann::json events = nlohmann::json::array(); std::string event_ids; mutex->unlock(); From 797cfe042f9b239385b9916bbf9c75653bbd790e Mon Sep 17 00:00:00 2001 From: turtledreams Date: Wed, 8 Oct 2025 18:25:25 +0900 Subject: [PATCH 2/2] version --- CHANGELOG.md | 2 +- include/countly/constants.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8286588..654f754 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## X.X.X +## 23.2.2 - Mitigated a mutex issue that can happen during update loop. ## 23.2.1 diff --git a/include/countly/constants.hpp b/include/countly/constants.hpp index ec80ee2..300e09e 100644 --- a/include/countly/constants.hpp +++ b/include/countly/constants.hpp @@ -13,7 +13,7 @@ #include #define COUNTLY_SDK_NAME "cpp-native-unknown" -#define COUNTLY_SDK_VERSION "23.2.1" +#define COUNTLY_SDK_VERSION "23.2.2" #define COUNTLY_POST_THRESHOLD 2000 #define COUNTLY_KEEPALIVE_INTERVAL 3000 #define COUNTLY_MAX_EVENTS_DEFAULT 200