My reading of the 0.8.0 documentation is that podofo_free should be used by 
callers to release memory allocated by podofo_alloc (e.g. the buffer returned 
by GetFilteredCopy)

This is pretty much essential when podofo is used as a Windows DLL since 
calling C runtime free() on the returned buffer isn't guaranteed to work across 
DLL boundaries.

When compiled as a static library everything works, but when compiled as a 
Windows DLL there are linker errors because podofo_free isn't exported as a 
public symbol (because there are no PODOFO_API prefixes on podofo_free, 
podofo_realloc and podofo_malloc)

If my understanding is correct here's a patch:

PdfMemoryManagement.h - add PODOFO_API
PODOFO_API void* podofo_malloc( size_t size );
PODOFO_API void* podofo_realloc( void* buffer, size_t size );
PODOFO_API void podofo_free( void* buffer );

PdfMemoryManagement.cpp
Add #include "PdfDefines.h" before first include.

Only tested on Visual Studio - don't have a linux tool chain currently (but 
looks correct after a quick scan of the GCC documentation).

PS Congratulations on getting the 0.8.0 release out - worked very smoothly 
apart from this issue.

Best Regards
Mark

Mark Rogers - mark.rog...@powermapper.com
PowerMapper Software Ltd - http://www.powermapper.com 



------------------------------------------------------------------------------
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to