Commit 31a4736c authored by Davis King's avatar Davis King

Changed code to avoid a potential race condition during program termination.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402865
parent d4d79c64
......@@ -120,12 +120,11 @@ namespace dlib
reg.m.lock();
const thread_id_type id = get_thread_id();
thread_id_type id_copy;
unsigned long count = reg.reg.count(id);
member_function_pointer<>::kernel_1a mfp;
// Remove all the member function pointers for this thread from the tree
// and call them.
for (unsigned long i = 0; i < count; ++i)
while (reg.reg[id] != 0)
{
reg.reg.remove(id,id_copy,mfp);
reg.m.unlock();
......
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