microsoft / msix-packaging

MSIX SDK
MIT License
964 stars 163 forks source link

Fix memory leak with openssl #485

Closed msftrubengu closed 2 years ago

msftrubengu commented 2 years ago

There's a memory leak with openssl where we don't cleanup openssl resources as described here: https://wiki.openssl.org/index.php/Library_Initialization#Cleanup

We don't need this fix in master as we just moved to a newer openssl and starting 1.1.0 you don't need to take do any cleanup.

A new API CleanupMsixSdk is introduced to cleanup the resources. Only non-Windows clients should call it, but there's no harm doing it on Windows.

The reason of the new API instead of calling it after unpack/unbundle is because we cannot just really clients can use the AppxPackaging interfaces and unpack multiple packages sequentially.

Also I had to fix AppxPackaging.hpp to be able to compile in modern clang for ADO pipelines to run