From bac60ff1264b7bfc129b7eab337ab5d9996a3cd6 Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 3 Oct 2015 21:06:32 +0200 Subject: [PATCH] Fixed crash on exit race with OpenGL 2.1 --- src/karts/kart_gfx.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/karts/kart_gfx.cpp b/src/karts/kart_gfx.cpp index 35785a31c..e1ead98e6 100644 --- a/src/karts/kart_gfx.cpp +++ b/src/karts/kart_gfx.cpp @@ -20,6 +20,7 @@ #include "config/user_config.hpp" #include "io/file_manager.hpp" +#include "graphics/central_settings.hpp" #include "graphics/irr_driver.hpp" #include "graphics/particle_emitter.hpp" #include "graphics/particle_kind.hpp" @@ -120,9 +121,13 @@ KartGFX::~KartGFX() if(m_all_emitters[i]) delete m_all_emitters[i]; } // for i < KGFX_COUNT - m_nitro_light->drop(); - m_skidding_light_1->drop(); - m_skidding_light_2->drop(); + + if (CVS->isGLSL()) + { + m_nitro_light->drop(); + m_skidding_light_1->drop(); + m_skidding_light_2->drop(); + } } // ~KartGFX