From 8b061c17dc0021803fc5aaf2c0faa85b5374e1f0 Mon Sep 17 00:00:00 2001 From: josh turpen Date: Sat, 15 Nov 2025 05:35:45 -0800 Subject: [PATCH] fix channel leak when controllers join/leave --- USrc/BS_xPlayer.uc | 20 ++++++++++++++++++++ USrc/UTComp_xBot.uc | 21 +++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/USrc/BS_xPlayer.uc b/USrc/BS_xPlayer.uc index 1981ca3..b35a001 100644 --- a/USrc/BS_xPlayer.uc +++ b/USrc/BS_xPlayer.uc @@ -3797,6 +3797,26 @@ simulated function ClientResetNetcode() } } +simulated function Destroyed() +{ + local LinkedReplicationInfo LPRI, Next; + + if(PlayerReplicationInfo != None) + { + LPRI = PlayerReplicationInfo.CustomReplicationInfo; + while(LPRI != None) + { + Next = LPRI.NextReplicationInfo; + LPRI.Destroy(); + LPRI = Next; + } + + PlayerReplicationInfo.CustomReplicationInfo = None; + } + + super.Destroyed(); +} + defaultproperties { diff --git a/USrc/UTComp_xBot.uc b/USrc/UTComp_xBot.uc index 9245eea..d45480d 100644 --- a/USrc/UTComp_xBot.uc +++ b/USrc/UTComp_xBot.uc @@ -16,6 +16,27 @@ function SetPawnClass(string inClass, string inCharacter) PlayerReplicationInfo.SetCharacterName(inCharacter); } +simulated function Destroyed() +{ + local LinkedReplicationInfo LPRI, Next; + + if(PlayerReplicationInfo != None) + { + LPRI = PlayerReplicationInfo.CustomReplicationInfo; + while(LPRI != None) + { + Next = LPRI.NextReplicationInfo; + LPRI.Destroy(); + LPRI = Next; + } + + PlayerReplicationInfo.CustomReplicationInfo = None; + PlayerReplicationInfo.Destroy(); + PlayerReplicationInfo = None; + } + + super.Destroyed(); +} defaultproperties {