The best way to test for memory over and under runs is to overload new and delete. I''m sure there''s other ways, but this is probably the easiest (and most flexible). In your new version of new, just allocate, say, 32 extra bytes and fill them with a certain character (not 0, but anything else should be fine) then return a pointer that''s 16 bytes into your allocated block. In the delete operator, check the 16 bytes before and 16 bytes after (you''ll have to store the length of the memory as well) and make sure they''re the same. If they''re not the original character you put there, then there''s been an overrun. There''s no way to (easily) test what caused the over run, unless you''ve got something like BoundsChecker, so to figure out what''s actually causing it will take several hours of just staring at the code

It''s probably tempting at this point to leave the delete commented out and maybe come back to the problem later, but I
strongly suggest you figure out the bug now because it''s probably a symptom of a much bigger problem...
War Worlds - A 3D Real-Time Strategy game in development.