0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2025-04-12 13:01:46 +02:00

ircd:🆑 Fix code::link() leaking program object.

This commit is contained in:
Jason Volk 2022-04-24 18:54:40 -07:00
parent d2833cb3e2
commit 3d2994d271

View file

@ -1527,10 +1527,11 @@ try
device[0] //TODO: XXX
};
assert(this->handle);
const uint num_progs {1};
const cl_program progs[]
{
cl_program(handle)
cl_program(this->handle)
};
log::logf
@ -1550,7 +1551,9 @@ try
};
#ifdef CL_VERSION_1_2
handle = clLinkProgram
void *handle
{
clLinkProgram
(
primary,
num_devices,
@ -1561,10 +1564,13 @@ try
cl::build_handle,
this,
&err
);
#endif
)
};
throw_on_error(err);
std::swap(handle, this->handle);
call(clReleaseProgram, cl_program(handle));
#endif
}
catch(const opencl_error &e)
{