You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to use a statically linked DLL, there should be a proper way of releasing the memory allocated for the returned markup text.
This could be as simple as a new export in cmark.h
CMARK_EXPORT
void freemarkup(void *ptr);
And in cmark.c:
void freemarkup(void *ptr) { free(ptr); }
Otherwise the calling parent process needs to release memory created by a child DLL, likely using different memory managers. In my case, calling the DLL from a Delphi application.
The text was updated successfully, but these errors were encountered:
To be more precise, this issue arises on Windows if you link the cmark DLL to the CRT (C library) statically. It should already be possible to work around this issue by using a custom memory allocator. Exposing the default allocator is a good idea nevertheless.
When attempting to use a statically linked DLL, there should be a proper way of releasing the memory allocated for the returned markup text.
This could be as simple as a new export in cmark.h
CMARK_EXPORT
void freemarkup(void *ptr);
And in cmark.c:
void freemarkup(void *ptr) { free(ptr); }
Otherwise the calling parent process needs to release memory created by a child DLL, likely using different memory managers. In my case, calling the DLL from a Delphi application.
The text was updated successfully, but these errors were encountered: