Some fixes in the sequence of quiting STK. Though the thread still gets killed before the request is done.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@13667 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
unitraxx 2013-09-12 02:29:05 +00:00
parent ed37d53be6
commit 5ba1493990
4 changed files with 5 additions and 5 deletions

View File

@ -1242,6 +1242,8 @@ void cleanSuperTuxKart()
if(INetworkHttp::get())
INetworkHttp::get()->stopNetworkThread();
if(Online::HTTPManager::isRunning())
Online::HTTPManager::get()->stopNetworkThread();
//delete in reverse order of what they were created in.
//see InitTuxkart()
Online::ServersManager::deallocate();
@ -1250,9 +1252,6 @@ void cleanSuperTuxKart()
Online::CurrentUser::deallocate();
GUIEngine::DialogQueue::deallocate();
if(Online::HTTPManager::isRunning())
Online::HTTPManager::get()->stopNetworkThread();
Referee::cleanup();
if(ReplayPlay::get()) ReplayPlay::destroy();

View File

@ -623,7 +623,7 @@ namespace Online{
{
if(isRegisteredUser())
{
HTTPRequest * request = new HTTPRequest(true, HTTPManager::MAX_PRIORITY);
XMLRequest * request = new XMLRequest(true, HTTPManager::MAX_PRIORITY);
request->setURL((std::string)UserConfigParams::m_server_multiplayer + "client-user.php");
request->setParameter("action", std::string("client-quit"));
request->setParameter("token", getToken());

View File

@ -134,7 +134,7 @@ namespace Online{
// and we couldn't finish STK. This way we request an abort of
// a download, which mean we can get the mutex and ask the service
// thread here to cancel properly.
cancelAllDownloads();
//cancelAllDownloads(); FIXME if used this way it also cancels the client-quit action
CurrentUser::get()->onSTKQuit();
addRequest(new Request(true, MAX_PRIORITY, Request::RT_QUIT));
} // stopNetworkThread

View File

@ -123,6 +123,7 @@ namespace Online{
postString.append(escaped);
curl_free(escaped);
}
Log::info( "HTTPRequest::operation", "Sending : %s", postString.c_str());
curl_easy_setopt(m_curl_session, CURLOPT_POSTFIELDS, postString.c_str());
std::string uagent( std::string("SuperTuxKart/") + STK_VERSION );
#ifdef WIN32