mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-06 19:47:02 +03:00
terminate correctly statically created tasks
This commit is contained in:
@@ -185,9 +185,6 @@ struct raop_ctx_s *raop_create(struct in_addr host, char *name,
|
||||
#ifdef WIN32
|
||||
// seems that Windows snprintf does not add NULL char if actual size > max
|
||||
id[63] = '\0';
|
||||
ctx->svc = mdnsd_register_svc(ctx->svr, id, "_raop._tcp.local", ctx->port, NULL, (const char**) txt);
|
||||
pthread_create(&ctx->thread, NULL, &rtsp_thread, ctx);
|
||||
|
||||
ctx->svc = mdnsd_register_svc(ctx->svr, id, "_raop._tcp.local", ctx->port, NULL, (const char**) txt);
|
||||
pthread_create(&ctx->thread, NULL, &rtsp_thread, ctx);
|
||||
|
||||
@@ -221,6 +218,7 @@ void raop_delete(struct raop_ctx_s *ctx) {
|
||||
// wake-up thread by connecting socket, needed for freeBSD
|
||||
sock = socket(AF_INET, SOCK_STREAM, 0);
|
||||
getsockname(ctx->sock, (struct sockaddr *) &addr, &nlen);
|
||||
connect(sock, (struct sockaddr*) &addr, sizeof(addr));
|
||||
closesocket(sock);
|
||||
|
||||
#ifdef WIN32
|
||||
@@ -369,7 +367,7 @@ static void *rtsp_thread(void *arg) {
|
||||
if (n > 0) res = handle_rtsp(ctx, sock);
|
||||
|
||||
if (n < 0 || !res) {
|
||||
closesocket(sock);
|
||||
closesocket(sock);
|
||||
LOG_INFO("RTSP close %u", sock);
|
||||
sock = -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user