Skip to content

Commit 0354e63

Browse files
committed
mutex fix
1 parent 29eea4f commit 0354e63

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## X.X.X
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.

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)