Skip to content

Commit a33a7a4

Browse files
fix: tsan
1 parent c6e14e9 commit a33a7a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/countly.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ Countly &Countly::getInstance() {
4545
}
4646

4747
#ifdef COUNTLY_BUILD_TESTS
48-
void Countly::halt() { _sharedInstance.reset(new Countly()); }
48+
void Countly::halt() {
49+
if (_sharedInstance) {
50+
_sharedInstance->stop(); // joins threads, releases mutex normally
51+
}
52+
_sharedInstance.reset(new Countly()); }
4953
#endif
5054

5155
/**

0 commit comments

Comments
 (0)