Fix crash: the ProjectileManager must be cleared before the CheckManager

(since a rubber ball will emove itself from all cannon checklines, so
a crash happens if the checklines are gone).
This commit is contained in:
hiker 2017-05-12 17:39:53 +10:00
parent 1b75ed9b4c
commit 490bef516e

View File

@ -436,6 +436,8 @@ World::~World()
irr_driver->onUnloadWorld();
projectile_manager->cleanup();
// In case that a race is aborted (e.g. track not found) track is 0.
if(Track::getCurrentTrack())
Track::getCurrentTrack()->cleanup();
@ -486,8 +488,6 @@ World::~World()
Camera::removeAllCameras();
projectile_manager->cleanup();
// In case that the track is not found, Physics was not instantiated,
// but kill handles this correctly.
Physics::kill();