From 127b0efe6fee1620647a2e249cbae9b8f13ee0cd Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Tue, 10 Feb 2015 20:04:01 +0200 Subject: 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 --- sc/source/core/opencl/formulagroupcl.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'sc') 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)) -- cgit