英文:
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) =>
{
grid.Children.Remove(VideoView);
};
mp.Stop();
var toDispose = mp;
var toDispose2 = libvlc;
Task.Run(() =>
{
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论