cosyneco / MediaPipe.NET

Pure .NET bindings for Google's MediaPipe.
MIT License
97 stars 18 forks source link

ImageFrame attempts to call a disposed method #24

Closed LeNitrous closed 2 years ago

LeNitrous commented 2 years ago

The line: https://github.com/vignetteapp/MediaPipe.NET/blob/ce85bd59a4323e110596597797540fb2b30b56d1/Mediapipe.Net/Framework/Format/ImageFrame.cs#L47

is synactic sugar for:

new Deleter(releasePixelData),

Since this allocates a new object and not to mention the call is in line, this will be a gen 0 object that can be garbage collected at any moment and any attempts to call this method will cause a crash.

Speykious commented 2 years ago

This is a regression from MediaPipeUnityPlugin. My fault, since I didn't understand the point of allocating a deleter handle. Will fix this shortly.