Can't free memory allocated in a C DLL?

Johannes Pfau spam at example.com
Fri Aug 5 03:10:25 PDT 2011


This is a reduced problem encountered with DTagLib on windows:
TagLib allocates memory using malloc in a DLL compiled with MSVC (or
mingw). When I try to free this memory in D the free() call just freezes
infinitely. Here's the reduced test case:
http://dl.dropbox.com/u/24218791/d/BUG.zip

Before I file the bug: Can this even be fixed without using the MSVC
runtime in D? Seems like this problem is caused by the different C
runtimes (The same example works fine with GDC on windows).

I guess this is also the reason why most C libraries have their own
*_free functions?

-- 
Johannes Pfau



More information about the Digitalmars-d mailing list