mirror of
https://github.com/textmate/textmate.git
synced 2026-01-20 20:27:59 -05:00
Avoid non-POD static data in thread
The issue here is that the thread can outlive the data.
This commit is contained in:
@@ -9,7 +9,7 @@ OAK_DEBUG_VAR(SCM_Git);
|
||||
|
||||
static scm::status::type parse_status_flag (std::string const& str)
|
||||
{
|
||||
static std::map<std::string, scm::status::type> const StatusLetterConversionMap
|
||||
static auto const StatusLetterConversionMap = new std::map<std::string, scm::status::type>
|
||||
{
|
||||
{ "?", scm::status::unversioned },
|
||||
{ "I", scm::status::ignored },
|
||||
@@ -21,8 +21,8 @@ static scm::status::type parse_status_flag (std::string const& str)
|
||||
{ "T", scm::status::modified } // type change, e.g. symbolic link → regular file
|
||||
};
|
||||
|
||||
auto it = StatusLetterConversionMap.find(str);
|
||||
if(it != StatusLetterConversionMap.end())
|
||||
auto it = StatusLetterConversionMap->find(str);
|
||||
if(it != StatusLetterConversionMap->end())
|
||||
return it->second;
|
||||
|
||||
ASSERT_EQ(str, NULL_STR); // we use ‘str’ in the assertion to output the unrecognized status flag
|
||||
|
||||
@@ -13,7 +13,7 @@ OAK_DEBUG_VAR(SCM_Svn);
|
||||
static scm::status::type parse_status_string (std::string const& status)
|
||||
{
|
||||
// Based on subversion/svn/status.c (generate_status_desc)
|
||||
static std::map<std::string, scm::status::type> const StatusMap
|
||||
static auto const StatusMap = new std::map<std::string, scm::status::type>
|
||||
{
|
||||
{ "none", scm::status::none },
|
||||
{ "normal", scm::status::none },
|
||||
@@ -30,8 +30,8 @@ static scm::status::type parse_status_string (std::string const& status)
|
||||
{ "unversioned", scm::status::unversioned },
|
||||
};
|
||||
|
||||
auto it = StatusMap.find(status);
|
||||
return it != StatusMap.end() ? it->second : scm::status::unknown;
|
||||
auto it = StatusMap->find(status);
|
||||
return it != StatusMap->end() ? it->second : scm::status::unknown;
|
||||
}
|
||||
|
||||
static void parse_status_output (scm::status_map_t& entries, std::string const& output)
|
||||
|
||||
Reference in New Issue
Block a user