Core/Misc: Minor change to make_unique_ptr_with_deleter to make it accept only pointers

This commit is contained in:
Shauren
2024-05-07 12:26:21 +02:00
parent 1db7b9fe56
commit 83f4763b25
7 changed files with 31 additions and 32 deletions

View File

@@ -217,7 +217,7 @@ int main(int argc, char** argv)
return 1;
}
auto sLoginServiceHandle = Trinity::make_unique_ptr_with_deleter(&dummy, [](void*) { sLoginService.StopNetwork(); });
auto sLoginServiceHandle = Trinity::make_unique_ptr_with_deleter(&sLoginService, [](Battlenet::LoginRESTService* service) { service->StopNetwork(); });
// Start the listening port (acceptor) for auth connections
int32 bnport = sConfigMgr->GetIntDefault("BattlenetPort", 1119);
@@ -230,7 +230,7 @@ int main(int argc, char** argv)
// Get the list of realms for the server
sRealmList->Initialize(*ioContext, sConfigMgr->GetIntDefault("RealmsStateUpdateDelay", 10));
auto sRealmListHandle = Trinity::make_unique_ptr_with_deleter(&dummy, [](void*) { sRealmList->Close(); });
auto sRealmListHandle = Trinity::make_unique_ptr_with_deleter(sRealmList, [](RealmList* realmList) { realmList->Close(); });
std::string bindIp = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
@@ -240,7 +240,7 @@ int main(int argc, char** argv)
return 1;
}
auto sSessionMgrHandle = Trinity::make_unique_ptr_with_deleter(&dummy, [](void*) { sSessionMgr.StopNetwork(); });
auto sSessionMgrHandle = Trinity::make_unique_ptr_with_deleter(&sSessionMgr, [](Battlenet::SessionManager* sessMgr) { sessMgr->StopNetwork(); });
// Set signal handlers
boost::asio::signal_set signals(*ioContext, SIGINT, SIGTERM);