diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index 933cd13a1c..ccc4632ad1 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -267,7 +267,8 @@ KartModel::~KartModel() if(m_is_master && m_wheel_model[i]) { irr_driver->dropAllTextures(m_wheel_model[i]); - irr_driver->removeMeshFromCache(m_wheel_model[i]); + if (m_wheel_model[i]->getReferenceCount() == 1) + irr_driver->removeMeshFromCache(m_wheel_model[i]); } }