diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-26 16:24:33 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-06-26 16:24:33 +0400 |
commit | e11e30aadfb719639aaa8e6f70b9fecb5c359dd3 (patch) | |
tree | f548869e03ac5ae9c87e55ce5419a68d0a806ea3 /intern | |
parent | 5eda86a6780596b2b5674e49a7791eb9545270eb (diff) |
Fix Cycles OpenCL issue if context/program creation fails, mistake by me,
patch #35866 by Doug Gale to fix it.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/device/device_opencl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp index 4f61f771df1..a127bd9e5d1 100644 --- a/intern/cycles/device/device_opencl.cpp +++ b/intern/cycles/device/device_opencl.cpp @@ -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); |