Skip to content

Commit

Permalink
Fix leaking FreePIEInstances
Browse files Browse the repository at this point in the history
  • Loading branch information
slonopotamus committed Aug 23, 2024
1 parent 6ab87bf commit db72889
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Source/UEST/Private/ScopedGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ UGameInstance* FScopedGameInstance::CreateClientFor(const UGameInstance* Server,

void FScopedGameInstance::DestroyGameInternal(UGameInstance& Game)
{
if (const auto* WorldContext = Game.GetWorldContext())
{
FreePIEInstances.Push(WorldContext->PIEInstance);
}

const auto OnlineSubsystemId = UOnlineEngineInterface::Get()->GetOnlineIdentifier(*Game.GetWorldContext());
const auto World = Game.GetWorld();
World->BeginTearingDown();
Expand Down Expand Up @@ -294,11 +299,6 @@ bool FScopedGameInstance::DestroyGame(UGameInstance* Game)
continue;
}

if (const auto* WorldContext = Game->GetWorldContext())
{
FreePIEInstances.Push(WorldContext->PIEInstance);
}

DestroyGameInternal(*Game);
Games.RemoveAt(Index);

Expand Down

0 comments on commit db72889

Please sign in to comment.