Commit Graph
14 Commits
Author SHA1 Message Date
Goober5000andClaude Opus 5 519e3aef21 Fix three memory leaks and make the debug leak check accurate
Report leaks after static destruction via _CRTDBG_LEAK_CHECK_DF instead of calling _CrtDumpMemoryLeaks() at the end of main(), which incorrectly reported every global container as a memory leak.

Also fix the three remaining real leaks which were discovered after all the noise was cleared up:
- Mc_point_list was never freed, because its atexit cleanup was only registered by code that no longer runs.  But the list was only a temporary array of pointers used while building the collision tree, so remove it and have model_collide_parse_bsp_defpoints() copy the vertices directly into the tree's point list.
- model_batch_buffer's Mem_alloc copy was never freed.  But the copy is actually not necessary, so remove it and pass Submodel_matrices directly.
- Goal_target_names strings were only freed when the next mission was parsed, so the last mission's names leaked at exit.  Hold them in SCP_vm_unique_ptr so they are freed with the vector.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
2026-09-13 14:25:01 -04:00
Goober5000 e8fdfa5513 clean up some obsolete fields
Remove `behavior`, `type`, and `wing`, which are either unused or redundant.
2022-11-07 22:43:50 -05:00
JohnAFernandez 87de1d1d77 Remove Int3()'s from ai.cpp and aibig.cpp 2020-09-14 20:53:31 -04:00
Goober5000 8667891fc2 use dynamic strings 2020-05-19 13:48:06 -04:00
Goober5000 5f74388790 add newline 2020-05-19 13:48:06 -04:00
Goober5000 067b250be9 make Goal_target_names dynamic
If ever there were more than 100 goal targets in a mission, the old version of ai_get_goal_target_name would start corrupting memory.  Rather than making a hacky workaround, this just makes it dynamic.
2020-05-19 13:48:06 -04:00
Goober5000 b146b10403 MOAR const-correctness! 2012-03-08 08:12:56 +00:00
chief1983 46d1ff7d7f Fixes #2578 - Change the < in these checks against NAME_LENGTH to <=. 2012-01-23 01:22:05 +00:00
Goober5000 3ce69f150a waypoints and waypoint paths now have dynamic limits 2011-08-30 03:35:42 +00:00
Echelon9 745ec904d5 Documentation: Minor tweaking to ai.cpp 2011-08-23 13:50:24 +00:00
Echelon9 365bd811c2 Documentation: First pass of AI code functions 2011-05-12 13:44:20 +00:00
The_E 431b8955e8 Another Assert() redirected to more useful things 2010-09-03 00:06:01 +00:00
portej05 98f337f701 safe_strings - from Antipodes build #1 2009-07-27 16:06:24 +00:00
wmcoolmon 36db6a4931 Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem. 2005-03-25 06:45:13 +00:00