fix(piopencl): release context on command queue creation failure

If clCreateContext succeeded but clCreateCommandQueue failed,
the context handle was returned without being released, leaking
the OpenCL context and all associated GPU resources.
This commit is contained in:
2026-08-10 16:26:18 +03:00
parent 4d2c268710
commit 9a4384a378
+1
View File
@@ -213,6 +213,7 @@ PIOpenCL::Context * PIOpenCL::Context::create(const PIOpenCL::DeviceList & dl) {
if (ret != 0) {
piCout << "[PIOpenCL::Context]"
<< "clCreateCommandQueue error" << ret;
clReleaseContext(con);
return 0;
}
piCout << "create done for" << dl[0].name;