mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-11 15:27:53 +00:00
Prevent segfault on exit for when accessory threads don't exist.
This commit is contained in:
parent
df1b9a6d90
commit
57c93d7e20
9
main.c
9
main.c
@ -1753,7 +1753,8 @@ void kill_work(void)
|
|||||||
|
|
||||||
/* Kill the watchdog thread */
|
/* Kill the watchdog thread */
|
||||||
thr = &thr_info[watchdog_thr_id];
|
thr = &thr_info[watchdog_thr_id];
|
||||||
pthread_cancel(*thr->pth);
|
if (thr->pth)
|
||||||
|
pthread_cancel(*thr->pth);
|
||||||
|
|
||||||
/* Stop the mining threads*/
|
/* Stop the mining threads*/
|
||||||
for (i = 0; i < mining_threads; i++) {
|
for (i = 0; i < mining_threads; i++) {
|
||||||
@ -1767,9 +1768,11 @@ void kill_work(void)
|
|||||||
|
|
||||||
/* Stop the others */
|
/* Stop the others */
|
||||||
thr = &thr_info[stage_thr_id];
|
thr = &thr_info[stage_thr_id];
|
||||||
pthread_cancel(*thr->pth);
|
if (thr->pth)
|
||||||
|
pthread_cancel(*thr->pth);
|
||||||
thr = &thr_info[longpoll_thr_id];
|
thr = &thr_info[longpoll_thr_id];
|
||||||
pthread_cancel(*thr->pth);
|
if (thr->pth)
|
||||||
|
pthread_cancel(*thr->pth);
|
||||||
|
|
||||||
wc = calloc(1, sizeof(*wc));
|
wc = calloc(1, sizeof(*wc));
|
||||||
if (unlikely(!wc)) {
|
if (unlikely(!wc)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user