-
Notifications
You must be signed in to change notification settings - Fork 89
[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
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.
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.
So the leaking AI Attack states were just ones leaking due to the issue with the AI Guard states, this PR does not actually do anything helpful in the end.
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.
So it can be closed?
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.
It was generals that i was seeing the leaked states within still, but i might not have had the AIGuard leak fix in place then, i will double check if there are leaking AI states there still and close this later if it's not going to be useful.
Yeah this is not needed in the end so going to close it, i think i was seeing things which the AI Guard state PR resolved. |
This PR cleans up memory leaks within a few different AI state machines.