Commit b4960ec36bca6663ecb0853752d0d777d81f9df1

Con Kolivas 2011-07-21T09:48:06

Free up resources/stale compilers.

diff --git a/main.c b/main.c
index efbd637..d5ec941 100644
--- a/main.c
+++ b/main.c
@@ -2781,6 +2781,10 @@ int main (int argc, char *argv[])
 #ifdef HAVE_OPENCL
 	i = 0;
 
+	/* Hopefully remove stale references to allow binaries to build */
+	if (nDevs)
+		clUnloadCompiler();
+
 	/* start GPU mining threads */
 	for (j = 0; j < nDevs * opt_g_threads; j++) {
 		int gpu = j % nDevs;
@@ -2819,6 +2823,10 @@ int main (int argc, char *argv[])
 		i++;
 	}
 
+	/* Free up resources */
+	if (nDevs)
+		clUnloadCompiler();
+
 	applog(LOG_INFO, "%d gpu miner threads started", gpu_threads);
 #endif