Browse Source

Bugfix: DevAPI: Don't call job_process_results when there was no previous job

Luke Dashjr 12 years ago
parent
commit
4d2391a545
1 changed files with 4 additions and 0 deletions
  1. 4 0
      deviceapi.c

+ 4 - 0
deviceapi.c

@@ -284,6 +284,7 @@ void job_results_fetched(struct thr_info *mythr)
 	if (mythr->_proceed_with_new_job)
 		do_job_start(mythr);
 	else
+	if (likely(mythr->prev_work))
 	{
 		struct timeval tv_now;
 		
@@ -325,6 +326,9 @@ void job_start_complete(struct thr_info *mythr)
 {
 	struct timeval tv_now;
 	
+	if (unlikely(!mythr->prev_work))
+		return;
+	
 	timer_set_now(&tv_now);
 	
 	do_process_results(mythr, &tv_now, mythr->prev_work, false);