Fix clang build, freeing memory too early

This commit is contained in:
Flakebi 2015-02-05 02:43:20 +01:00
parent 366f8a26bb
commit d8efe01d02

View File

@ -350,10 +350,13 @@ void LinearWorld::newLap(unsigned int kart_index)
std::string s = StringUtils::timeToString(time_per_lap);
irr::core::stringw m_fastest_lap_message;
// Store the temporary string because clang would mess this up
// (remove the stringw before the wchar_t* is used).
core::stringw css = kart->getName();
//I18N: as in "fastest lap: 60 seconds by Wilber"
m_fastest_lap_message += _C("fastest_lap", "%s by %s", s.c_str(),
core::stringw(kart->getName()));
irr::core::stringw m_fastest_lap_message =
_C("fastest_lap", "%s by %s", s.c_str(), css.c_str());
m_race_gui->addMessage(m_fastest_lap_message, NULL,
3.0f, video::SColor(255, 255, 255, 255), false);