MP-MediaInfo icon indicating copy to clipboard operation
MP-MediaInfo copied to clipboard

Memory Leak in MediaInfoWrapper Usage

Open Vesperino opened this issue 10 months ago • 0 comments

When using the MediaInfoWrapper class to handle media file information in my application, I encounter a significant memory leak issue. Below is a snippet of the code:

var mediaInfo = new MediaInfoWrapper(filePath, _logger); double totalSeconds = TimeSpan.FromMilliseconds(mediaInfo.Duration).TotalSeconds; int roundedSeconds = (int)Math.Round(totalSeconds); I need to process 2860 media files, and I've noticed that the MediaInfoWrapper instances are not disposed of after their usage. Unfortunately, the MediaInfoWrapper class does not implement the IDisposable interface, which exacerbates the memory management issues. This oversight leads to increased memory consumption and potential application instability over time.

Could the implementation be updated to include IDisposable, or could another mechanism for proper resource management be provided?

Thank you.

Vesperino avatar Apr 18 '24 12:04 Vesperino