cancel
Showing results for 
Search instead for 
Did you mean: 

PC Graphics

abdyla
Journeyman III

Detecting Handle leaks for AMF

I think I found a handle leak in AMF. The project CPPSamples\SimpleDecoder was used as a base to demonstrate the issue. If the InitDX11 method is called, after the resources are released, one handle of type 'Thread' remains open. There is no such problem with InitDX9 and InitDX12 calls. If this is a bug in the drivers, where can I report it so that it can be fixed?

int main() {
    AMF_RESULT res = AMF_OK;
    amf::AMFFactory* pFactory;
    HMODULE hDLLHandle;
	//...
    int iter = 0;
    while (true) {
        amf::AMFContextPtr context = nullptr;
        amf::AMFComponentPtr decoder = nullptr;
        res = pFactory->CreateContext(&context);
        if (context)
			res = context->InitDX11(NULL); // can be DX11 device
        if (decoder)
            decoder->Terminate();
        if (context)
            context->Terminate();
        decoder = nullptr;
        context = nullptr;
        printf("\r#iter = %d (Pause - %d, UseDX11 - %d)\r", ++iter, (int)bPause, (int)bUseDX);
    }
    if (hDLLHandle)
        FreeLibrary(hDLLHandle);
    hDLLHandle = nullptr;
    pFactory = nullptr;
    return 0;
}
0 Likes
0 Replies