Possible leak in NVENC h.264 encoder MFT

Hi, I think there may be a pretty significant resource leak in the NVENC h.264 encoder Media Foundation transform. Please see this question on Stack Overflow for more details and sample code: https://stackoverflow.com/q/61945544/8921979

As far as I can tell I am using the encoder as described by the Media Foundation docs on Hardware MFTs, yet I am observing a leak. Is there something special to consider when using the NVENC implementation? I have found a workaround by dereferencing the D3D device after each frame submission, but this is not ideal.

Thanks,
Otto Itkonen
Software by KeloCube