Fix Cycles OpenCL issue if context/program creation fails, mistake by me,
patch #35866 by Doug Gale to fix it.
This commit is contained in:
@@ -241,6 +241,9 @@ public:
|
||||
{
|
||||
cl_context context = get_something<cl_context>(platform, device, &Slot::context, slot_locker);
|
||||
|
||||
if(!context)
|
||||
return NULL;
|
||||
|
||||
/* caller is going to release it when done with it, so retain it */
|
||||
cl_int ciErr = clRetainContext(context);
|
||||
assert(ciErr == CL_SUCCESS);
|
||||
@@ -255,6 +258,9 @@ public:
|
||||
{
|
||||
cl_program program = get_something<cl_program>(platform, device, &Slot::program, slot_locker);
|
||||
|
||||
if(!program)
|
||||
return NULL;
|
||||
|
||||
/* caller is going to release it when done with it, so retain it */
|
||||
cl_int ciErr = clRetainProgram(program);
|
||||
assert(ciErr == CL_SUCCESS);
|
||||
|
Reference in New Issue
Block a user