Fix various memory leaks
This commit is contained in:
parent
f8f73b0cd7
commit
f6d45f7990
5 changed files with 19 additions and 1 deletions
|
@ -28,13 +28,19 @@
|
|||
|
||||
namespace xmrig {
|
||||
|
||||
static Storage<DnsUvBackend>* storage = nullptr;
|
||||
|
||||
Storage<DnsUvBackend>& DnsUvBackend::getStorage()
|
||||
{
|
||||
static Storage<DnsUvBackend>* storage = new Storage<DnsUvBackend>();
|
||||
if (storage == nullptr) storage = new Storage<DnsUvBackend>();
|
||||
return *storage;
|
||||
}
|
||||
|
||||
void DnsUvBackend::releaseStorage()
|
||||
{
|
||||
delete storage;
|
||||
}
|
||||
|
||||
static addrinfo hints{};
|
||||
|
||||
|
||||
|
@ -56,6 +62,7 @@ xmrig::DnsUvBackend::DnsUvBackend()
|
|||
xmrig::DnsUvBackend::~DnsUvBackend()
|
||||
{
|
||||
getStorage().release(m_key);
|
||||
releaseStorage();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue