Skip to content

MLB-BIOMETRIC/Microsoft.iOS.AVSemanticSegmentationMatte-memoryleak

Repository files navigation

MEMORY LEAK FIXED

The memory leak can be fixed by using the MattingImage instead of the hairmaskraw directly!

using var cihairmask = new CIImage(hairmaskraw.MattingImage);

Read more here: dotnet/macios#19518 (comment)

Microsoft.iOS.AVSemanticSegmentationMatte-memoryleak

This repo reproduces the AVSemanticSegmentationMatte memory leak of 2,98 MB.

This memory leak specifically happens in the code below:

var hairmaskraw = photo.GetSemanticSegmentationMatte(AVSemanticSegmentationMatteType.Hair);

Furthermore, there is also a bug where the code line above only works for the first 4 images. Then it stops working and returns null for images taken after.

Apple Instruments

Use Apple Instruments software and run an "Allocation" test on the repo. This will show the the memory leak.

Instruments with 4 memory leaks

About

Reproducable memory leak

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages