[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57770] trunk/blender/intern/cycles/device /device_opencl.cpp: Fix Cycles OpenCL issue if context/ program creation fails, mistake by me,

Brecht Van Lommel brechtvanlommel at pandora.be
Wed Jun 26 14:24:34 CEST 2013


Revision: 57770
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57770
Author:   blendix
Date:     2013-06-26 12:24:33 +0000 (Wed, 26 Jun 2013)
Log Message:
-----------
Fix Cycles OpenCL issue if context/program creation fails, mistake by me,
patch #35866 by Doug Gale to fix it.

Modified Paths:
--------------
    trunk/blender/intern/cycles/device/device_opencl.cpp

Modified: trunk/blender/intern/cycles/device/device_opencl.cpp
===================================================================
--- trunk/blender/intern/cycles/device/device_opencl.cpp	2013-06-26 11:46:55 UTC (rev 57769)
+++ trunk/blender/intern/cycles/device/device_opencl.cpp	2013-06-26 12:24:33 UTC (rev 57770)
@@ -241,6 +241,9 @@
 	{
 		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 @@
 	{
 		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);




More information about the Bf-blender-cvs mailing list