File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
GeneralsMD/Code/GameEngine/Source/Common/RTS
Generals/Code/GameEngine/Source/Common/RTS Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -1301,6 +1301,10 @@ void Player::preTeamDestroy( const Team *team )
1301
1301
// ai notification callback
1302
1302
if ( m_ai )
1303
1303
m_ai->aiPreTeamDestroy ( team );
1304
+
1305
+ // TheSuperHackers @bugfix Mauller/Xezon 03/05/2025 Clear the default team to prevent dangling pointer usage
1306
+ if ( m_defaultTeam == team )
1307
+ m_defaultTeam = NULL ;
1304
1308
} // preTeamDestroy
1305
1309
1306
1310
// -------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -1652,6 +1652,10 @@ void Player::preTeamDestroy( const Team *team )
1652
1652
// ai notification callback
1653
1653
if ( m_ai )
1654
1654
m_ai->aiPreTeamDestroy ( team );
1655
+
1656
+ // TheSuperHackers @bugfix Mauller/Xezon 03/05/2025 Clear the default team to prevent dangling pointer usage
1657
+ if ( m_defaultTeam == team )
1658
+ m_defaultTeam = NULL ;
1655
1659
} // preTeamDestroy
1656
1660
1657
1661
// -------------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments