mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
fixed race condition at startup
This commit is contained in:
parent
1fc5dacd87
commit
0bf2abaa4c
@ -435,8 +435,13 @@ namespace crypto
|
|||||||
std::unique_ptr<Ed25519>& GetEd25519 ()
|
std::unique_ptr<Ed25519>& GetEd25519 ()
|
||||||
{
|
{
|
||||||
if (!g_Ed25519)
|
if (!g_Ed25519)
|
||||||
g_Ed25519.reset (new Ed25519());
|
{
|
||||||
|
auto c = new Ed25519();
|
||||||
|
if (!g_Ed25519) // make sure it was not created already
|
||||||
|
g_Ed25519.reset (c);
|
||||||
|
else
|
||||||
|
delete c;
|
||||||
|
}
|
||||||
return g_Ed25519;
|
return g_Ed25519;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user