
Roland Schwarz wrote:
Have a look at the thread on the users list:
Which thread?
Re: [Boost-users] Re: Memory leak reported using threads library
Basically because: #if (defined(_DLL) || defined(_RTLDLL)) && defined(BOOST_DYN_LINK) # define BOOST_LIB_PREFIX #elif defined(BOOST_DYN_LINK) # error "Mixing a dll boost library with a static runtime is a really bad idea..." #else # define BOOST_LIB_PREFIX "lib" #endif
This doesn't explain why one shouldn't use a shared rt with the static boost.thread lib! [IMO there got some things mixed up.] IIRC the code above is only considered when there is no static TSS cleanup possible for a certain compiler, no?
and Peter Dimov wrote:
It works as long as you don' allocate in one and delete in the other. C-style interfaces are fine, but passing a std::string from the EXE to the DLL (or vice versa) will fail. shared_ptr will work, though :-) unless you unload the DLL that has created it, of course. Deleting an object with a virtual destructor works, too.
AFAIK this is a common (DLL) problem and not specific to the thread library. Stefan