Closed jdwoolcock closed 5 years ago
FFMe has an internal reference counter for unmanaged allocations. This message is an indication that there is a real memory leak. Let me check out your code.
Ok, I see what the problem is. The reference counter keeps track of unmanaged references for all media container instances. When there are more media containers, this message appears. Note how the message does not appear when you close the last MediaElement. Since this meant for development diagnostics only, I have updated the message being logged to a more proper explanation.
Thanks for the report!
Multiple instances of Media Element - Unmanaged references were left alive.
I have a simple WPF application that has multiple instances of the ffmediaelement player. When I close an instance and there are other instances running I get the error message. Unmanaged references were left alive. This is an indication that there is a memory leak. Is this actually a problem or just an erroneous error message.
Issue Categories
Version Information
Steps to Reproduce
I have attached a simple example FfmeTest that illustrates the problem. It has 4 media panels each one has a play and stop button. Start playing multiple instances and then press stop on one of the windows.
The following error message is logged
[34:18.002 | ERR | ReferenceCounter ] Unmanaged references were left alive. This is an indication that there is a memory leak. CodecContext - MediaComponent.cs; Line: 79, Member: .ctor - Instances: 2 SwrContext - AudioComponent.cs; Line: 112, Member: MaterializeFrame - Instances: 1 Packet - MediaPacket.cs; Line: 83, Member: CreateReadPacket - Instances: 22 SwsContext - VideoComponent.cs; Line: 233, Member: MaterializeFrame - Instances: 1
FfmeTest.zip
Commands to play and close