From 197f6939432b661a1407ddece98e98311684b1d5 Mon Sep 17 00:00:00 2001 From: xapantu Date: Fri, 10 Sep 2010 18:22:10 +0000 Subject: [PATCH] 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 --- data/gui/addons_view_dialog.stkgui | 16 ++++++++-------- src/states_screens/main_menu_screen.cpp | 2 +- src/states_screens/main_menu_screen.hpp | 6 +++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/data/gui/addons_view_dialog.stkgui b/data/gui/addons_view_dialog.stkgui index e00c643a9..deb1cc57e 100644 --- a/data/gui/addons_view_dialog.stkgui +++ b/data/gui/addons_view_dialog.stkgui @@ -1,20 +1,20 @@ -
-
+
+
-
-
+
+
+
+
diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 2d85f1270..5ed238e05 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -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); diff --git a/src/states_screens/main_menu_screen.hpp b/src/states_screens/main_menu_screen.hpp index 638e15d0b..444eead33 100644 --- a/src/states_screens/main_menu_screen.hpp +++ b/src/states_screens/main_menu_screen.hpp @@ -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 *);