1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-15 19:02:44 -05:00

replace new/delete with sp

This commit is contained in:
4ertus2
2024-10-20 08:24:09 +03:00
parent e32731b60b
commit ab5be0b773
71 changed files with 271 additions and 387 deletions

View File

@@ -29,13 +29,13 @@
namespace xmrig {
static Storage<DnsUvBackend> *storage = nullptr;
static std::shared_ptr<Storage<DnsUvBackend>> storage = nullptr;
Storage<DnsUvBackend> &DnsUvBackend::getStorage()
{
if (storage == nullptr) {
storage = new Storage<DnsUvBackend>();
if (!storage) {
storage = std::make_shared<Storage<DnsUvBackend>>();
}
return *storage;
@@ -67,8 +67,7 @@ xmrig::DnsUvBackend::~DnsUvBackend()
storage->release(m_key);
if (storage->isEmpty()) {
delete storage;
storage = nullptr;
storage.reset();
}
}