Commit 5898acce authored by Seungha Yang's avatar Seungha Yang 🐑 Committed by Tim-Philipp Müller

nvenc: Don't leak CUDA device memory

Allocated device memory should be freed with cuMemFree
parent 1410f521
......@@ -1012,6 +1012,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
Markdown is supported
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