0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01: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,21 +1551,26 @@ try
};
#ifdef CL_VERSION_1_2
handle = clLinkProgram
(
primary,
num_devices,
device_list,
opts.c_str(),
num_progs,
progs,
cl::build_handle,
this,
&err
);
#endif
void *handle
{
clLinkProgram
(
primary,
num_devices,
device_list,
opts.c_str(),
num_progs,
progs,
cl::build_handle,
this,
&err
)
};
throw_on_error(err);
std::swap(handle, this->handle);
call(clReleaseProgram, cl_program(handle));
#endif
}
catch(const opencl_error &e)
{