[web] slow 4.1.6 shutdown; request to cancel ws loop

This commit is contained in:
whatdoineed2do/Ray 2022-02-22 14:54:55 +00:00
parent 92279ef33d
commit f33ccb9238
1 changed files with 2 additions and 1 deletions

View File

@ -429,7 +429,6 @@ websocket(void *arg)
#endif #endif
} }
lws_context_destroy(context);
pthread_exit(NULL); pthread_exit(NULL);
} }
@ -541,9 +540,11 @@ websocket_deinit(void)
return; return;
websocket_exit = true; websocket_exit = true;
lws_cancel_service(context);
ret = pthread_join(tid_websocket, NULL); ret = pthread_join(tid_websocket, NULL);
if (ret < 0) if (ret < 0)
DPRINTF(E_LOG, L_WEB, "Error joining websocket thread (%d): %s\n", ret, strerror(ret)); DPRINTF(E_LOG, L_WEB, "Error joining websocket thread (%d): %s\n", ret, strerror(ret));
lws_context_destroy(context);
pthread_mutex_destroy(&websocket_write_event_lock); pthread_mutex_destroy(&websocket_write_event_lock);
} }