diff --git a/sgminer.c b/sgminer.c index 0debd9bc..62bd8ef1 100644 --- a/sgminer.c +++ b/sgminer.c @@ -8122,15 +8122,15 @@ static void restart_mining_threads(unsigned int new_n_threads) for (i = 0; i < total_devices; ++i) { struct cgpu_info *cgpu = devices[i]; + cgpu->thr = (struct thr_info **)malloc(sizeof(struct thr_info *) * (cgpu->threads+1)); + cgpu->thr[cgpu->threads] = NULL; + cgpu->status = LIFE_INIT; + if (cgpu->deven == DEV_DISABLED && opt_removedisabled) { cgpu->threads = 0; continue; } - cgpu->thr = (struct thr_info **)malloc(sizeof(struct thr_info *) * (cgpu->threads+1)); - cgpu->thr[cgpu->threads] = NULL; - cgpu->status = LIFE_INIT; - for (j = 0; j < cgpu->threads; ++j, ++k) { thr = mining_thr[k];