Commit aaee2820 authored by Seungha Yang's avatar Seungha Yang 🐑 Committed by Matthew Waters
Browse files

nvenc: Don't leak CUDA device memory

Allocated device memory should be freed with cuMemFree
parent d0f2f262
Pipeline #26431 passed with stages
in 35 minutes and 31 seconds
......@@ -998,6 +998,12 @@ gst_nv_base_enc_free_buffers (GstNvBaseEnc * nvenc)
GST_ERROR_OBJECT (nvenc, "Failed to unregister resource %p, ret %d",
in_gl_resource, nv_ret);
nv_ret = cuMemFree ((CUdeviceptr) in_gl_resource->cuda_pointer);
if (nv_ret != NV_ENC_SUCCESS) {
GST_ERROR_OBJECT (nvenc, "Failed to free CUDA device memory, ret %d",
g_free (in_gl_resource);
cuCtxPopCurrent (NULL);
} else
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment