Unregister default plugins on deinitialization
Unregister default plugins to prevent memory leaks in plugin's objects, for example, ctxIdxLookup in libde265
I'm wondering when the destructor will ever be called since this is a static, global singleton variable.
@farindk yes, you're right, thank you. So, I created another PR with API methods to deinitialize plugins manually: https://github.com/strukturag/libheif/pull/656
And I found that there are couple of issues related to problem I'm facing: https://github.com/strukturag/libheif/issues/531 and https://github.com/strukturag/libheif/issues/535
Thank you. I have merged this, but changed the usage. Instead of calling heif_unregister_*(), it is now good practice to initialize and cleanup with heif_init() and heif_deinit(). These are reference counted, heif_deinit() will then effectively call heif_unregister_*().
Please try in the master branch and let me know if you see any issues with this.
@farindk thank you! I've try the master branch and everything works perfect.