ffmpeginteropx / FFmpegInteropX

FFmpeg decoding library for Windows 10 UWP and WinUI 3 Apps
Apache License 2.0
205 stars 52 forks source link

Fix access violation when closing TexturePool #321

Closed lukasf closed 1 year ago

lukasf commented 1 year ago

I am 100% sure that I have already seen that, and we talked about this somewhere. So I was really surprised to see that this is still in the codebase. Found this again when working on the auto ref PR.

The TexturePool has a list of com_refs. They will call Release() automatically when they are cleaned up. So we must not call AddRef() or Release() when using com_refs, as this dangerously gets into the way of automatic house keeping. Somehow, we still had Release() calls here, which could result in access violations if timing is bad.

brabebhin commented 1 year ago

This is probably my bad.