Changeset 530

Show
Ignore:
Timestamp:
05/22/09 09:36:40 (3 years ago)
Author:
uncle_fungus
Message:

Make string accesses from threads always use copies

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/benchmarksDialog.cpp

    r524 r530  
    262262        { 
    263263                // Use the name of the client if found, its location otherwise 
    264                 clientLocation = BenchmarksManager::GetInstance()->GetClientLocationFromClientId(benchmarks[i]->GetClientId())
     264                clientLocation = BenchmarksManager::GetInstance()->GetClientLocationFromClientId(benchmarks[i]->GetClientId()).c_str()
    265265#ifdef _FAHMON_WIN32_ 
    266266                // fixes old benchmarks from version 2.3.1 and earlier which used forward slash instead of back slash 
     
    268268                        clientLocation.Replace(_T("/"), _T("\\")); 
    269269#endif 
    270                 clientName     = ClientsManager::GetInstance()->GetNameFromLocation(clientLocation.c_str())
     270                clientName     = ClientsManager::GetInstance()->GetNameFromLocation(clientLocation.c_str()).c_str()
    271271 
    272272                if(clientName.IsEmpty() == false) 
  • trunk/src/client.cpp

    r527 r530  
    7070void Client::SetLocation(const wxString& location) 
    7171{ 
    72         mLocation = location
     72        mLocation = location.c_str()
    7373 
    7474        // Ensure that the location ends with a slash 
     
    301301                                for(i=0; i<nbBenchmarks; ++i) 
    302302                                { 
    303                                         clientLocation = BenchmarksManager::GetInstance()->GetClientLocationFromClientId(benchmarks[i]->GetClientId())
    304                                         clientName     = ClientsManager::GetInstance()->GetNameFromLocation(clientLocation.c_str())
     303                                        clientLocation = BenchmarksManager::GetInstance()->GetClientLocationFromClientId(benchmarks[i]->GetClientId()).c_str()
     304                                        clientName     = ClientsManager::GetInstance()->GetNameFromLocation(clientLocation.c_str()).c_str()
    305305                                        if (clientName == mName) 
    306306                                        { 
     
    378378        if (project != INVALID_PROJECT_ID && project != 0) 
    379379        { 
    380                 mCore = Core::IdToLongName(project->GetCoreId())
     380                mCore = Core::IdToLongName(project->GetCoreId()).c_str()
    381381                mCredit = project->GetCredit(); 
    382                 mClientType = Core::IdToClientType(project->GetCoreId())
     382                mClientType = Core::IdToClientType(project->GetCoreId()).c_str()
    383383                if(mDownloadDate.IsValid() && project->GetPreferredDeadlineInDays() != 0) 
    384384                { 
     
    413413        } 
    414414 
    415         mLog = myLog
     415        mLog = myLog.c_str()
    416416        SetPreviousFAHlog(localFile); 
    417417        return true; 
     
    568568#ifdef _FAHMON_WIN32_ 
    569569        if(multiProtocolFile::GetFileProtocol(mLocation) != multiProtocolFile::HTTP && multiProtocolFile::GetFileProtocol(mLocation) != multiProtocolFile::FTP) 
    570                 xyzInFile  = mLocation + _T("work\\current.xyz"); 
     570                xyzInFile  = wxString::Format(wxT("%swork\\current.xyz"), mLocation.c_str()); 
    571571        else 
    572572#endif 
    573                 xyzInFile  = mLocation + _T("work/current.xyz"); 
     573                xyzInFile  = wxString::Format(wxT("%swork/current.xyz"), mLocation.c_str()); 
    574574        // Create the complete path of the files 
    575575        xyzOutFile = PathManager::GetXYZPath() + wxString::Format(_T("%i"), mProjectId) + _T(".xyz");