19 Nov
2004
19 Nov
'04
12:46 p.m.
The following code leaks memory for each iteration of the loop for (;;) { boost::thread t(func); t.join(); } void func() { cout << "------" << endl; } If I replace func with func2 void func2() { try { throw 1; } catch {} } then it still leaks. But if I say fill up a vector with stuff or just return there is no leek. The interesting part is that it doesn't leak if use the version of threads built using the CRT as a .dll rather than static link. I also believe that the actual culprit is somewhere in boost.function since the code for boost.thread is so straight forward. I'm currently using boost 1.30 so it might have already been addressed in newer versions. Can anyone help?