Fix T45484: Regression OpenCL split: access violation

That was a primary school error caused by moving statements inside assert()
which effectivly disabled crucial code in release builds.
This commit is contained in:
Sergey Sharybin
2015-07-18 23:30:19 +02:00
parent faeac63f68
commit 4bca8a6bc5

View File

@@ -548,7 +548,9 @@ public:
return NULL; return NULL;
/* caller is going to release it when done with it, so retain it */ /* caller is going to release it when done with it, so retain it */
assert(clRetainProgram(program) == CL_SUCCESS); cl_int ciErr = clRetainProgram(program);
assert(ciErr == CL_SUCCESS);
(void)ciErr;
return program; return program;
} }
@@ -567,7 +569,9 @@ public:
/* increment reference count in OpenCL. /* increment reference count in OpenCL.
* The caller is going to release the object when done with it. */ * The caller is going to release the object when done with it. */
assert(clRetainContext(context) == CL_SUCCESS); cl_int ciErr = clRetainContext(context);
assert(ciErr == CL_SUCCESS);
(void)ciErr;
} }
/* see store_something comment */ /* see store_something comment */
@@ -600,7 +604,9 @@ public:
/* Increment reference count in OpenCL. /* Increment reference count in OpenCL.
* The caller is going to release the object when done with it. * The caller is going to release the object when done with it.
*/ */
assert(clRetainProgram(program) == CL_SUCCESS); cl_int ciErr = clRetainProgram(program);
assert(ciErr == CL_SUCCESS);
(void)ciErr;
} }
/* Discard all cached contexts and programs. */ /* Discard all cached contexts and programs. */