BoundsChecker is reporting a memory leak for every ‘bind’
call. I am using the threadpool includes, v 0.2.3, with “libboost_thread-vc71-mt-gd-1_33_1.lib”,
MSVC 7.1. Any help is appreciated.
The usage is similar to the following
working example:
void task(int param1)
{
// performs some task
printf("%d :
Param1 : %d\n", GetCurrentThreadId(), param1);
Sleep(1000);
}
void foo()
{
boost::threadpool::pool tp(5); // Threadpool with 5 threads
while
(1)
{
for (int i = 0;
i < 10; i++)
{
// Seems like there is memory allocation which is not
// deallocated after returning from the function
call.
tp.schedule(boost::bind(task, i));
}
tp.wait(); // wait to finish off the remaining
tasks
Sleep(5000); // sleep
for 5 seconds
}
}