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
}
lws_context_destroy(context);
pthread_exit(NULL);
}
@ -541,9 +540,11 @@ websocket_deinit(void)
return;
websocket_exit = true;
lws_cancel_service(context);
ret = pthread_join(tid_websocket, NULL);
if (ret < 0)
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);
}