-
Notifications
You must be signed in to change notification settings - Fork 85
[GEN][ZH] Fix memory leaks within various AIAttackStateMachines #1351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -735,6 +736,8 @@ AIStateMachine::~AIStateMachine() | |||
{ | |||
deleteInstance(m_goalSquad); | |||
} | |||
|
|||
clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it could change behaviour with what AIStateMachine
does on clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah i just noticed that there is also the signal to the ai.
it could be that the changes here can disappear if the problem is just cleanup within the states themselves.
@@ -1998,6 +2001,7 @@ AIAttackMoveStateMachine::AIAttackMoveStateMachine(Object *owner, AsciiString na | |||
//---------------------------------------------------------------------------------------------------------- | |||
AIAttackMoveStateMachine::~AIAttackMoveStateMachine() | |||
{ | |||
clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show what was leaking here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Various AIAttackstates that were appearing in the Generals shell map as being leaked after close.
I need to check back over it again later the same with the AIGuard state stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking it again, i think the issue is that the AIAttack states are leaking in a similar fashion to the guard states, i am going to repurpose this PR to implement their destructors and so that the other PR does not get too long.
This PR cleans up memory leaks within a few different AI state machines.