1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-23 06:44:38 +01:00

Remove the use of shared_ptr for the Context (#24404)

* Replace shared_ptr with unique_ptr for Context systems, return refs

* Fix all the users

* clang-format fix

* Fix linux builds
This commit is contained in:
Matt
2025-05-15 22:46:06 +03:00
committed by GitHub
parent c2e042e5e1
commit 42df41efdb
68 changed files with 286 additions and 303 deletions

View File

@@ -189,8 +189,8 @@ std::vector<ServerListEntry> ServerList::ReadFavourites() const
std::vector<ServerListEntry> entries;
try
{
auto env = GetContext()->GetPlatformEnvironment();
auto path = env->GetFilePath(PathId::networkServers);
auto& env = GetContext()->GetPlatformEnvironment();
auto path = env.GetFilePath(PathId::networkServers);
if (File::Exists(path))
{
auto fs = FileStream(path, FileMode::open);
@@ -242,8 +242,8 @@ bool ServerList::WriteFavourites(const std::vector<ServerListEntry>& entries) co
{
LOG_VERBOSE("server_list_write(%d, 0x%p)", entries.size(), entries.data());
auto env = GetContext()->GetPlatformEnvironment();
auto path = Path::Combine(env->GetDirectoryPath(DirBase::user), u8"servers.cfg");
auto& env = GetContext()->GetPlatformEnvironment();
auto path = Path::Combine(env.GetDirectoryPath(DirBase::user), u8"servers.cfg");
try
{