GarageGames / Torque3D Public
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
ITickable, deletion inside advanceTime #436
Conversation
|
Copy of #435 |
|
I approve ;) |
|
What is the special case at the end handling? If the last object in the list deletes itself then the size() method should return one less and the for() loop will dump out. Or have I missed something? |
|
@DavidWyand-GG Hmm it was originally added because it kept iterating, but this may very well be fixed when I changed it to loop from 0 to size instead of from begin to end. Give me a sec to test and correct Edit: removed the old commit and added a new one without special case. |
|
Yeah, if you were still using begin() and end() it would have been necessary. |
|
Charlie Patterson pointed out that getProcesslist()[i] in the if-clause may fail if the object is the last object in the list and it gets deleted so that i would be out of index bounds. |
|
Changed it but would you prefer a single commit or 2 commits? |
|
@lukaspj If you could please make a new Pull Request with a single commit that would be great. Makes it easier to see what your final result is. Thanks! |
Adds a fix for when an ITickable object deletes itself inside the advanceTime procedure.
|
@DavidWyand-GG With a little GitHub magic, a new pull request is unnecessary, now it's just a single commit! |
|
Nice trick, I need to remember that one! |
|
We took another look at this and I'm still not sure why you do the check for If you only include the test for |
|
If |
|
This has been replaced with pull request #529 to both extend the support for deleted objects with ITickable processing, and to format the code to fit T3D norms. |
Adds a fix for when an ITickable object deletes itself inside the advanceTime procedure.
As discussed here
Kudos to David Wyand for this thread which explains the issue and helped me alot.