Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Generals/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ TurretAI::~TurretAI()
stopRotOrPitchSound();

if (m_turretStateMachine)
{
// TheSuperHackers @bugfix xezon 2025 Halt the state machine before deleting it to prevent
// StateMachine::~StateMachine() from calling onExit() on the current state, which may
// access the owning object's AI interface (already nulled in Object::~Object()) and crash.
m_turretStateMachine->halt();
deleteInstance(m_turretStateMachine);
}
}

// ------------------------------------------------------------------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/AI/TurretAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ TurretAI::~TurretAI()
stopRotOrPitchSound();

if (m_turretStateMachine)
{
// TheSuperHackers @bugfix xezon 2025 Halt the state machine before deleting it to prevent
// StateMachine::~StateMachine() from calling onExit() on the current state, which may
// access the owning object's AI interface (already nulled in Object::~Object()) and crash.
m_turretStateMachine->halt();
deleteInstance(m_turretStateMachine);
}
}

// ------------------------------------------------------------------------------------------------
Expand Down
Loading