Commit 079a6bc3 by Nico Weber

Remove an exit-time destructor from a frequently-included header.

Bug: angleproject:1459 Change-Id: I2bfd7a34ef8ca6d367af7e1d9dd740c4e93727ac Reviewed-on: https://chromium-review.googlesource.com/1255382 Commit-Queue: Nico Weber <thakis@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 2fe5e1d3
......@@ -150,14 +150,15 @@ inline bool IsMaskFlagSet(T mask, T flag)
inline const char *MakeStaticString(const std::string &str)
{
static std::set<std::string> strings;
std::set<std::string>::iterator it = strings.find(str);
if (it != strings.end())
// On the heap so that no destructor runs on application exit.
static std::set<std::string> *strings = new std::set<std::string>;
std::set<std::string>::iterator it = strings->find(str);
if (it != strings->end())
{
return it->c_str();
}
return strings.insert(str).first->c_str();
return strings->insert(str).first->c_str();
}
std::string ArrayString(unsigned int i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment