diff --git a/src/addons/network_http.cpp b/src/addons/network_http.cpp index 1158875cd..b6f163306 100644 --- a/src/addons/network_http.cpp +++ b/src/addons/network_http.cpp @@ -18,6 +18,7 @@ #include "addons/network_http.hpp" #include +#include #include #include @@ -76,7 +77,12 @@ NetworkHttp::NetworkHttp() : m_news(std::vector()), pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE); - pthread_create(&m_thread_id, &attr, &NetworkHttp::mainLoop, this); + int error=pthread_create(&m_thread_id, &attr, &NetworkHttp::mainLoop, this); + if(error) + { + m_thread_id = 0; + printf("[addons] Warning: could not create thread, error=%d.\n", errno); + } pthread_attr_destroy(&attr); } // NetworkHttp @@ -193,11 +199,16 @@ NetworkHttp::~NetworkHttp() pthread_cond_signal(&m_cond_command); } pthread_mutex_unlock(&m_mutex_command); - printf("[addons] Mutex unlocked.\n"); + if(UserConfigParams::m_verbosity>=3) + printf("[addons] Mutex unlocked.\n"); - void *result; - pthread_join(m_thread_id, &result); - printf("[addons] Network thread joined.\n"); + if(m_thread_id) + { + void *result; + pthread_join(m_thread_id, &result); + if(UserConfigParams::m_verbosity>=3) + printf("[addons] Network thread joined.\n"); + } pthread_mutex_destroy(&m_mutex_command); pthread_cond_destroy(&m_cond_command); diff --git a/src/states_screens/minimal_race_gui.cpp b/src/states_screens/minimal_race_gui.cpp index a873b2cfd..b7c30ecc0 100644 --- a/src/states_screens/minimal_race_gui.cpp +++ b/src/states_screens/minimal_race_gui.cpp @@ -580,10 +580,10 @@ void MinimalRaceGUI::drawRankLap(const KartIconDisplayInfo* info, - m_lap_width -20 ); pos.UpperLeftCorner.Y = viewport.LowerRightCorner.Y-60; + printf("x %d %d\n", pos.UpperLeftCorner.Y, pos.LowerRightCorner.Y); char str[256]; sprintf(str, "%d/%d", lap+1, race_manager->getNumLaps()); core::stringw s = m_string_lap+" "+str; - float scale = font->getScale(); font->draw(s.c_str(), pos, color); } }