Closed airtaxi closed 9 months ago
Hi @airtaxi and thanks for the finding. SwapChain release will cause issues but for WinUI it seems to work fine now. The issue comes from the SwapChainPanel that keeps a reference inside it and it should be disposed but currently using a single instance for the template.
I'm making the video camera related application like below:
Since it uses multiple camera feeds, I noticed that FlyleafLib.Controls.WinUI has a memory leak problem.
The image below is a memory usage screenshot of my program after creating 10 instances of FlyleafHost.
It's over 600+mb, and if I comment out the "Player" allocation code from Flyleaf Host, it doesn't cause the memory leak problem.
After some investigation, I found that if I add the lines of code highlighted below, the memory leak doesn't happen anymore.
Below is the screenshot of my application with the same condition after adding the two lines of code above.
Edit: removed CI/BI