Skip to content

Commit 8c4a5de

Browse files
zenakutenDeaod
authored andcommitted
fix channel leak when controllers join/leave
1 parent 4ddd20c commit 8c4a5de

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

USrc/BS_xPlayer.uc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3797,6 +3797,26 @@ simulated function ClientResetNetcode()
37973797
}
37983798
}
37993799
3800+
simulated function Destroyed()
3801+
{
3802+
local LinkedReplicationInfo LPRI, Next;
3803+
3804+
if(PlayerReplicationInfo != None)
3805+
{
3806+
LPRI = PlayerReplicationInfo.CustomReplicationInfo;
3807+
while(LPRI != None)
3808+
{
3809+
Next = LPRI.NextReplicationInfo;
3810+
LPRI.Destroy();
3811+
LPRI = Next;
3812+
}
3813+
3814+
PlayerReplicationInfo.CustomReplicationInfo = None;
3815+
}
3816+
3817+
super.Destroyed();
3818+
}
3819+
38003820
defaultproperties
38013821
{
38023822

USrc/UTComp_xBot.uc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ function SetPawnClass(string inClass, string inCharacter)
1616
PlayerReplicationInfo.SetCharacterName(inCharacter);
1717
}
1818

19+
simulated function Destroyed()
20+
{
21+
local LinkedReplicationInfo LPRI, Next;
22+
23+
if(PlayerReplicationInfo != None)
24+
{
25+
LPRI = PlayerReplicationInfo.CustomReplicationInfo;
26+
while(LPRI != None)
27+
{
28+
Next = LPRI.NextReplicationInfo;
29+
LPRI.Destroy();
30+
LPRI = Next;
31+
}
32+
33+
PlayerReplicationInfo.CustomReplicationInfo = None;
34+
PlayerReplicationInfo.Destroy();
35+
PlayerReplicationInfo = None;
36+
}
37+
38+
super.Destroyed();
39+
}
1940

2041
defaultproperties
2142
{

0 commit comments

Comments
 (0)