Retain cl program after every possible place we might build the program.
diff --git a/ocl.c b/ocl.c
index 28d5a87..7e16f60 100644
--- a/ocl.c
+++ b/ocl.c
@@ -639,6 +639,12 @@ built:
applog(LOG_INFO, "%s", log);
return NULL;
}
+
+ clRetainProgram(clState->program);
+ if (status != CL_SUCCESS) {
+ applog(LOG_ERR, "Error: Retaining Program (clRetainProgram)");
+ return NULL;
+ }
}
/* get a kernel object handle for a kernel with the given name */