hughsie / colord

Making color management just work
GNU General Public License v2.0
75 stars 51 forks source link

lib: avoid destructing LCMS plugin twice with lcms 2.14 #146

Closed thesamesam closed 2 years ago

thesamesam commented 2 years ago

lcms 2.14 contains a change to avoid a memory leak, but that change assumes correct API usage. It's not necessary to both cmsUnregisterPluginsTHR() and then cmsDeleteContext() -- we can just straight up delete the LCMS context instead (cmsDeleteContext()).

So, follow upstream's suggestion & do that. This fixes memory corruption when building colord on x86, for example.

Bug: https://github.com/mm2/Little-CMS/issues/344 Fixes: https://github.com/hughsie/colord/issues/145 Signed-off-by: Sam James sam@gentoo.org

hughsie commented 2 years ago

Thanks Sam, much appreciated.

thesamesam commented 2 years ago

No problem @hughsie, thanks for the quick merge!