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:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user