From: Stefan Slapeta (stefan_at_[hidden])
Date: 2004-12-06 06:09:10
Roland Schwarz wrote:
> Have a look at the thread on the users list:
> 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..."
> # define BOOST_LIB_PREFIX "lib"
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?
> 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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk