Browse Source

Merge commit 'e0d4443' into bfgminer

Luke Dashjr 13 years ago
parent
commit
f29568bdfd
1 changed files with 2 additions and 0 deletions
  1. 2 0
      deviceapi.c

+ 2 - 0
deviceapi.c

@@ -197,6 +197,8 @@ bool do_job_prepare(struct thr_info *mythr, struct timeval *tvp_now)
 		mythr->work_restart = false;
 		request_work(mythr);
 		// FIXME: Allow get_work to return NULL to retry on notification
+		if (mythr->next_work)
+			free_work(mythr->next_work);
 		mythr->next_work = get_work(mythr);
 		if (api->prepare_work && !api->prepare_work(mythr, mythr->next_work)) {
 			applog(LOG_ERR, "%"PRIpreprv": Work prepare failed, disabling!", proc->proc_repr);