From 6cd84d1ec51ee92aa4d5932886628d54d048d25e Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 3 Aug 2012 22:40:52 +0200 Subject: [PATCH] Changed: #1440 Return a different temporary directory every time --HG-- branch : build_pipeline_v3 --- code/nel/tools/pipeline/service/pipeline_project.cpp | 11 ++++++----- code/nel/tools/pipeline/service/pipeline_project.h | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/nel/tools/pipeline/service/pipeline_project.cpp b/code/nel/tools/pipeline/service/pipeline_project.cpp index c9f8e78c8..7311996f9 100644 --- a/code/nel/tools/pipeline/service/pipeline_project.cpp +++ b/code/nel/tools/pipeline/service/pipeline_project.cpp @@ -213,7 +213,8 @@ std::string CPipelineProject::getOutputDirectory() std::string CPipelineProject::getTempDirectory() { - if (m_TempDirectory.empty()) + std::string tempDirectory; + do { std::stringstream ss; ss << g_WorkDir; @@ -225,10 +226,10 @@ std::string CPipelineProject::getTempDirectory() ss << rand(); ss << PIPELINE_DIRECTORY_TEMP_SUFFIX; ss << "/"; - NLMISC::CFile::createDirectoryTree(ss.str()); - m_TempDirectory = ss.str(); - } - return m_TempDirectory; + tempDirectory = ss.str(); + } while (NLMISC::CFile::isDirectory(tempDirectory)); + NLMISC::CFile::createDirectoryTree(tempDirectory); + return tempDirectory; } void CPipelineProject::parseValue(std::string &result, const std::string &value) diff --git a/code/nel/tools/pipeline/service/pipeline_project.h b/code/nel/tools/pipeline/service/pipeline_project.h index 555a4237d..037dd4ec1 100644 --- a/code/nel/tools/pipeline/service/pipeline_project.h +++ b/code/nel/tools/pipeline/service/pipeline_project.h @@ -53,7 +53,6 @@ class CPipelineProject protected: CPipelineWorkspace *m_Workspace; NLMISC::CRefPtr m_Form; - std::string m_TempDirectory; uint32 m_ChangedReference; uint32 m_FileSizeReference; uint32 m_CRC32;