cmark-gfm icon indicating copy to clipboard operation
cmark-gfm copied to clipboard

How to unregister cmark-gfm plugins?

Open rysavyjan opened this issue 6 years ago • 2 comments

After cmark_gfm_core_extensions_ensure_registered() is called, how should we unregister these plugins and free allocated memory?

rysavyjan avatar Jun 21 '19 06:06 rysavyjan

There is as yet no mechanism to deregister plugins. We would need to add methods for each extension to deallocate any memory or objects allocated during their creation, and to track the created cmark_syntax_extension *s in core-extensions.c so we can free them.

kivikakk avatar Jun 21 '19 06:06 kivikakk

@rysavyjan I use cmark_release_plugins(); to make my valgrind report w/o errors (unfortunately it's not possible to do ensure/register more than once, therefore I had to use std::atexit() to release plugins).

dvorka avatar Jan 18 '20 12:01 dvorka