summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2015-02-10 20:04:01 +0200
committerTor Lillqvist <tml@collabora.com>2015-02-10 20:29:42 +0200
commit127b0efe6fee1620647a2e249cbae9b8f13ee0cd (patch)
tree01909fe249a18e93ed9915c2af7fe63747ab4a2c
parentAdd SAL_INFOs for tracing kernel and program life cycle (diff)
downloadcore-127b0efe6fee1620647a2e249cbae9b8f13ee0cd.tar.gz
core-127b0efe6fee1620647a2e249cbae9b8f13ee0cd.zip
Don't call clReleaseProgram() on the same program twice
If the clBuildProgram() failed, the lastSecondProgram variable kept as its value the already released program handle, and later we called clReleaseProgram() on it again. This is certainly wrong, and caused a crash at least with my OpenCL implementation. As such I am not sure if that lastOneProgram, lastSecondProgram etc dance is sane... Change-Id: Ia30426fbba9118ad7e20f13ef35daa5f78a1f0a1
-rw-r--r--sc/source/core/opencl/formulagroupcl.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx
index a70c0f72ab0c..6f42d2c42469 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3837,6 +3837,7 @@ void DynamicKernel::CreateKernel()
SAL_INFO("sc.opencl", "Releasing program " << lastSecondProgram);
err = clReleaseProgram(lastSecondProgram);
SAL_WARN_IF(err != CL_SUCCESS, "sc.opencl", "clReleaseProgram failed: " << ::opencl::errorString(err));
+ lastSecondProgram = NULL;
}
if (::opencl::buildProgramFromBinary("",
&::opencl::gpuEnv, KernelHash.c_str(), 0))