File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1- sole <a href =" https://travis-ci.org/r-lyeh/sole " ><img src =" https://api.travis-ci.org/r-lyeh/sole.svg?branch=master " align =" right " /></a >
1+ sole <a href =" https://travis-ci.org/r-lyeh/sole " ><img src =" https://api.travis-ci.org/r-lyeh-archived /sole.svg?branch=master " align =" right " /></a >
22====
33
44- Sole is a lightweight C++11 library to generate universally unique identificators (UUID).
@@ -73,6 +73,7 @@ uuid v4 rebuilt : bdd55e2f-6f6b-4088-8703-ddedba9456a2 -> version=4,randbits=bdd
7373- clang/g++ users: both ` -std=c++11 ` and ` -lrt ` may be required when compiling ` sole.cpp `
7474
7575### Changelog
76+ - v1.0.4 (2022/04/09): Fix potential threaded issues (fix #18 , PR #39 ) and a socket leak (fix #38 )
7677- v1.0.3 (2022/01/17): Merge fixes by @jasonwinterpixel (emscripten) + @jj-tetraquark (get_any_mac)
7778- v1.0.2 (2021/03/16): Merge speed improvements by @vihangm
7879- v1.0.1 (2017/05/16): Improve UUID4 and base62 performance; Fix warnings
Original file line number Diff line number Diff line change 5454
5555// public API
5656
57- #define SOLE_VERSION " 1.0.3" /* (2022/01/17): Merge fixes by @jasonwinterpixel(emscripten) + @jj-tetraquark(get_any_mac)
57+ #define SOLE_VERSION " 1.0.4" /* (2022/04/09): Fix potential threaded issues (fix #18, PR #39) and a socket leak (fix #38)
58+ #define SOLE_VERSION "1.0.3" // (2022/01/17): Merge fixes by @jasonwinterpixel(emscripten) + @jj-tetraquark(get_any_mac)
5859#define SOLE_VERSION "1.0.2" // (2021/03/16): Merge speed improvements by @vihangm
5960#define SOLE_VERSION "1.0.1" // (2017/05/16): Improve UUID4 and base62 performance; fix warnings
6061#define SOLE_VERSION "1.0.0" // (2016/02/03): Initial semver adherence; Switch to header-only; Remove warnings */
@@ -601,7 +602,7 @@ namespace sole {
601602 int s = socket (PF_INET, SOCK_DGRAM, 0 );
602603 if (s == -1 ) continue ;
603604
604- if (std::strcmp (" lo" , ifap->ifa_name ) == 0 ) continue ; // loopback address is zero
605+ if (std::strcmp (" lo" , ifap->ifa_name ) == 0 ) { close (s); continue ;} // loopback address is zero
605606
606607 std::strcpy (ifr.ifr_name , ifap->ifa_name );
607608 int rc = ioctl (s, SIOCGIFHWADDR, &ifr);
@@ -664,8 +665,8 @@ namespace sole {
664665 // UUID implementations
665666
666667 inline uuid uuid4 () {
667- static std::random_device rd;
668- static std::uniform_int_distribution<uint64_t > dist (0 , (uint64_t )(~0 ));
668+ static $ msvc ( __declspec (thread)) $ melse (__thread) std::random_device rd;
669+ static $ msvc ( __declspec (thread)) $ melse (__thread) std::uniform_int_distribution<uint64_t > dist (0 , (uint64_t )(~0 ));
669670
670671 uuid my;
671672
You can’t perform that action at this time.
0 commit comments