fix API::exit issue

This commit is contained in:
Jinhao 2015-05-03 23:12:18 +08:00
parent e449cd5a24
commit 1b01493e9f

View File

@ -264,20 +264,18 @@ namespace API
if((wd->thread_id == tid) && (wd->root != root))
{
root = wd->root;
bool exists = false;
for (auto i = roots.cbegin(); i != roots.cend(); ++i)
{
if (*i == root)
{
root = nullptr;
exists = true;
break;
}
}
if (!root)
{
root = wd->root;
if (!exists)
roots.push_back(root);
}
}
}