LibVLCSharp – WinUI – 内存泄漏?

huangapple go评论82阅读模式
英文:

LibVLCSharp - WinUI - Memory Leak?

问题

LibVLCSharp现已适用于WinUI,其文档可在此处找到。

这是个好消息,感谢您分享。

我遇到了内存使用问题。每当我启动和停止播放器时,没有释放所有的内存,结果内存使用量不断增加。

我尝试释放播放器和库,但这不起作用。

我有一个简单的示例在此

关于最佳方法,您有什么建议吗?

英文:

LibVLCSharp is now available for WinUI, and its documentation can be found here.
<br/>This is great news, and thank you for sharing it.

I am experiencing an issue with memory usage. Whenever I start and stop the player, not all of the memory is released, and as a result, the memory usage keeps growing..

I tried disposing of the player and the library, but this is not working.

private void MovieWindow_Closed(object sender, WindowEventArgs args)
{
    mp.Stopped += (s, e) =&gt;
    {
        grid.Children.Remove(VideoView);
    };
    mp.Stop();

    var toDispose = mp;
    var toDispose2 = libvlc;
    Task.Run(() =&gt;
    {
        toDispose?.Dispose();
        toDispose2?.Dispose();
    });
}

I have a simple sample available here.
Any suggestions on the best approach?

答案1

得分: 1

我认为你遇到了mfkl在开发过程中看到的问题:https://github.com/videolan/libvlcsharp/pull/301

如果是同一个内存泄漏,它已经在libvlc中修复了:https://code.videolan.org/videolan/vlc/-/merge_requests/3441

然而,修复尚未发布,它将在下一个libvlc nuget包中发布。

英文:

I think you ran into the issue that mfkl saw during development : https://github.com/videolan/libvlcsharp/pull/301

If that's the same leak, it was fixed in libvlc : https://code.videolan.org/videolan/vlc/-/merge_requests/3441

However, the fix has not been released yet, it will be in the next libvlc nuget package.

huangapple
  • 本文由 发表于 2023年5月21日 15:45:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76298812.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定