Fix more potential crash at shutdown regarding with add-on threads

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@6154 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria
2010-09-27 01:27:06 +00:00
parent 3c2f45a556
commit 6432d83c27

View File

@@ -67,7 +67,10 @@ void MainMenuScreen::changeNewsText(std::string action)
{
FILE* newsFile = NULL;
char buffer[1024] = "";
pthread_testcancel(); // check if thread was cancelled
newsFile = fopen(std::string(file_manager->getConfigDir() + "/news").c_str(), "r+");
if (newsFile == NULL)
{
fprintf(stderr, "Warning: cannot open news files\n");
@@ -82,6 +85,7 @@ void MainMenuScreen::changeNewsText(std::string action)
fclose(newsFile);
pthread_testcancel(); // check if thread was cancelled
// to remove the break line.
//info.replace(info.size()-1,1, "");
//std::cout << info << std::endl;