Merge pull request #1445 from whatdoineed2do/websocket-slow-shutdown

[web] slow 4.1.6 shutdown; request to cancel ws loop
This commit is contained in:
Christian Meffert 2022-04-06 17:27:38 +02:00 committed by GitHub
commit 176142f311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
} }