Calling delete particle changes the _particles vector (due to how the CMiniMem::Deallocate is implemented) thus invalidating the loop iterator.
|
for (auto particle : _particles) |
|
{ |
|
particle->Die(); |
|
delete particle; |
|
} |
To reproduce create some particles and change map while particles still exist.
Calling
delete particlechanges the_particlesvector (due to how theCMiniMem::Deallocateis implemented) thus invalidating the loop iterator.halflife-updated/cl_dll/particleman/CMiniMem.cpp
Lines 213 to 217 in d2da2f1
To reproduce create some particles and change map while particles still exist.