Intel® oneAPI Threading Building Blocks
Ask questions and share information about adding parallelism to your applications when using this threading library.

Windows: problems with STLport + leaks

New Contributor III
Hi, sorry for not posting this as a bug report, but bugzilla doesn't work.

I think I've found a few problems in the handle_win_error function in tbb_thread.cpp:

1. The FormatMessage function with FORMAT_MESSAGE_ALLOCATE_BUFFER flag allocates memory with LocalAlloc. This memory is never freed. LocalFree should be called.
2. The std::runtime_error exception has an explicit constructor from std::string (19.1.6), but a LPTSTR (which is char*) is passed. This prevents the code from compiling with STLPort. I believe, an explicit construction of std::string from msg_buf is required. Don't forget to include too.

My config:
Windows XP SP1
tbb20_20080408src (modified Makefiles to add include and library paths for STLPort; otherwise untouched)
MSVC 7.1 (Visual Studio 2003 .NET)
STLPort 5.1.4

0 Kudos
1 Reply
Thank you for the reportwith sodetailed description. I hope next OSS release will contains fixes for the mentioned issues.