Browse Source

Don't try to stop/cancel threads that don't exist.

Con Kolivas 14 years ago
parent
commit
f4f018b498
1 changed files with 2 additions and 0 deletions
  1. 2 0
      main.c

+ 2 - 0
main.c

@@ -981,6 +981,8 @@ void kill_work(void)
 	/* Stop the mining threads*/
 	for (i = 0; i < mining_threads; i++) {
 		thr = &thr_info[i];
+		if (!thr->pth)
+			continue;
 		tq_freeze(thr->q);
 		/* No need to check if this succeeds or not */
 		pthread_cancel(thr->pth);