Skip to content

Commit f725c1a

Browse files
authored
Merge pull request #140 from Countly/cpp-mutex-fix
Mutex fix
2 parents 29eea4f + 797cfe0 commit f725c1a

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 23.2.2
2+
- Mitigated a mutex issue that can happen during update loop.
3+
14
## 23.2.1
25
- Added manual session control via "Countly::enableManualSessionControl". When enabled, automatic session calls are ignored, while manual calls remain usable for finer control.
36
- Added "checkRQSize" function to return the current number of requests in the queue.

include/countly/constants.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <string>
1414

1515
#define COUNTLY_SDK_NAME "cpp-native-unknown"
16-
#define COUNTLY_SDK_VERSION "23.2.1"
16+
#define COUNTLY_SDK_VERSION "23.2.2"
1717
#define COUNTLY_POST_THRESHOLD 2000
1818
#define COUNTLY_KEEPALIVE_INTERVAL 3000
1919
#define COUNTLY_MAX_EVENTS_DEFAULT 200

src/countly.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ void Countly::start(const std::string &app_key, const std::string &host, int por
373373
#ifdef COUNTLY_USE_SQLITE
374374
if (configuration->databasePath == "" || configuration->databasePath == " ") {
375375
log(LogLevel::ERROR, "[Countly][start] Database path can not be empty or blank.");
376+
mutex->unlock();
376377
return;
377378
}
378379
#endif
@@ -806,7 +807,8 @@ bool Countly::updateSession() {
806807

807808
void Countly::packEvents() {
808809
try {
809-
// events array
810+
mutex->lock();
811+
// events array
810812
nlohmann::json events = nlohmann::json::array();
811813
std::string event_ids;
812814
mutex->unlock();

0 commit comments

Comments
 (0)