Commit c7ccde69 authored by Alexander Alekhin's avatar Alexander Alekhin

fix TLS implementation (closes #5967)

parent 3d2fc6c2
......@@ -1085,11 +1085,14 @@ public:
for(size_t i = 0; i < threads.size(); i++)
{
std::vector<void*>& thread_slots = threads[i]->slots;
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
if(threads[i])
{
dataVec.push_back(thread_slots[slotIdx]);
threads[i]->slots[slotIdx] = 0;
std::vector<void*>& thread_slots = threads[i]->slots;
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
{
dataVec.push_back(thread_slots[slotIdx]);
threads[i]->slots[slotIdx] = 0;
}
}
}
......@@ -1116,9 +1119,12 @@ public:
for(size_t i = 0; i < threads.size(); i++)
{
std::vector<void*>& thread_slots = threads[i]->slots;
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
dataVec.push_back(thread_slots[slotIdx]);
if(threads[i])
{
std::vector<void*>& thread_slots = threads[i]->slots;
if (thread_slots.size() > slotIdx && thread_slots[slotIdx])
dataVec.push_back(thread_slots[slotIdx]);
}
}
}
......
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