Minor fixes

This commit is contained in:
DH 2014-02-19 19:27:52 +02:00
parent b85a86b225
commit b1df7444a4
5 changed files with 103 additions and 73 deletions

View file

@ -113,7 +113,20 @@ thread::thread()
void thread::start(std::function<void()> func)
{ // got a crash related with strings
m_thr = std::thread([this, func]() { NamedThreadBase info(m_name); g_tls_this_thread = &info; func(); });
m_thr = std::thread([this, func]()
{
try
{
NamedThreadBase info(m_name);
g_tls_this_thread = &info;
func();
}
catch(...)
{
ConLog.Error("Crash :(");
terminate();
}
});
}
void thread::detach()