FW: Leak when using boost threads under VC .NET using statically linked CRT
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?
On Fri, 19 Nov 2004 12:46:19 -0000, alansa@ati-uk.com
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.
This sounds more like a mismatch between the runtime libraries that Boost was compiled for (MSVCRT.DLL I'm pretty sure) and the one you're linking with. Do you get a linker error indicating that there are conflicting libraries? -- Caleb Epstein caleb dot epstein at gmail dot com
participants (2)
-
alansaļ¼ ati-uk.com
-
Caleb Epstein