Move the main menu screen thread canceling to tearDown because ~MainMenuScreen is never called

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@5956 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
xapantu 2010-09-10 18:22:10 +00:00
parent 96d7bbf345
commit 197f693943
3 changed files with 14 additions and 10 deletions

View File

@ -1,20 +1,20 @@
<stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="horizontal-row" >
<div width="50%" height="100%" layout="vertical-row" >
<div x="0%" y="10%" width="90%" height="80%" layout="horizontal-row" >
<div width="50%" height="90%" layout="vertical-row" >
<icon id="icon" align="center" proportion="8" width="100%" icon="gui/logo.png"/>
<button id="cancel" I18N="Addons" text="Back" align="center"/>
</div>
<div width="50%" height="100%" layout="vertical-row" >
<div width="50%" height="90%" layout="vertical-row" >
<label id="name" width="100%" text="Name:" proportion="1" />
<label word_wrap="true" id="description" width="100%" text="Description:" proportion="1" />
<label id="version" width="100%" text="Version:" proportion="1" />
<spacer height="25" width="10" />
<button id="install" I18N="Addons" text="Install" align="center"/>
<spacer height="10" width="10" />
</div>
</div>
<div x="90%" y = "10%" width="80%" height="10%" layout="horizontal-row" >
<button id="cancel" I18N="Addons" text="Back" align="center"/>
<button id="install" I18N="Addons" text="Install" align="center"/>
</div>
</stkgui>

View File

@ -243,7 +243,7 @@ void * MainMenuScreen::downloadNews( void * pthis)
#endif
// ------------------------------------------------------------------------------------------------------
#ifdef ADDONS_MANAGER
MainMenuScreen::~MainMenuScreen()
void MainMenuScreen::tearDown()
{
fprintf(stdout, "canceling the thread");
pthread_cancel(m_thread_news_text);

View File

@ -36,7 +36,6 @@ public:
void changeNewsText(std::string action);
pthread_mutex_t m_mutex_news_text;
pthread_t m_thread_news_text;
~MainMenuScreen();
std::string m_news_text;
void onUpdate(float delta, irr::video::IVideoDriver* driver);
#endif
@ -49,6 +48,11 @@ public:
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void init();
#ifdef ADDONS_MANAGER
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void tearDown();
#endif
/** This function is used to download a text from the server to show the news. */
static void * downloadNews(void *);