Community
cancel
Showing results for 
Search instead for 
Did you mean: 
David_C_15
Beginner
26 Views

MFXClose fails to deallocate memory

 Hi all, 

 I'm working on a project which uses multiple threads,

and each thread dynamically creates MFXVideoSession for decoding's purpose.

The problem is that whenever i try to Close() after a DisjoinSession() ,

Close() returns MFX_ERR_INVALID_HANDLE.

Eventually, memory leaks when the whole system is shutting down.

Does anyone have solution to this problem? or can give a reason why it happens?

I'll thank whomever gives it, in advance.

The version of meida sdk used is 2013 R2 by the way,

and here's my dev platform info.

OS: Win 7 (64bit)
CPU: i7-3770
Main Board : Asrock B75M
Mem :8 GB

Regards, David

0 Kudos
3 Replies
andy4us
Beginner
26 Views

Don't call DisjoinSession() before calling close. As you found out that invalidates the handle. If you have multiple sessions, create a master session, have your sessions join to that, then on close, have the joined sessions call disjoinsession, and the master session, call close().

Petter_L_Intel
Employee
26 Views

Hi,

Also make sure you do not close the parent session until all child sessions are disjoined or closed.

Regards,
Petter 

David_C_15
Beginner
26 Views

Thank you all,  andy4us and Petter Larsson!

The advice really helped me out.

To add a bit, I think intel should provide a little more specific documentation on media sdk.

Regards, David