Browse Source

Bugfix: When disabling device, ensure its prev_work (if any) gets freed properly

Luke Dashjr 12 years ago
parent
commit
7341aba32a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      miner.c

+ 2 - 0
miner.c

@@ -6626,6 +6626,8 @@ void mt_disable_start(struct thr_info *mythr)
 	int thr_id = mythr->id;
 	int thr_id = mythr->id;
 	
 	
 	hashmeter2(mythr);
 	hashmeter2(mythr);
+	if (mythr->prev_work)
+		free_work(mythr->prev_work);
 	mythr->prev_work = mythr->work;
 	mythr->prev_work = mythr->work;
 	mythr->work = NULL;
 	mythr->work = NULL;
 	mythr->_job_transition_in_progress = false;
 	mythr->_job_transition_in_progress = false;