Question about Connections

When I connect a function to CharacterAdded, do I need to disconnect it when the player leaves to prevent memory leaks, or does it disconnect on its own, would the following code be fine?

game.Players.PlayerAdded:Connect(functions(player)
    player.CharacterAdded:Connect(function(Char)
        -- // Do something
    end)
end)

Or should I disconnect it when the player leaves like this?

local connections = {}
game.Players.PlayerAdded:Connect(function(player)
    connections[player] = player.CharacterAdded:Connect(function(Char)
        -- // Do something
    end)
end)

game.Players.PlayerRemoving:Connect(function(player)
    if connections[player] then 
        connections[player]:Disconnect() 
    end
end)

Any help is appreciated!

I’ve never seen someone disconnect it unless they might want to end part of (or a whole) a loop.

When a player leaves their ‘Player’ object is destroyed and any of its connections are disconnected.

disconnects all connections