Fix memory leak (startup only)

This commit is contained in:
Andreas Öman 2009-06-10 06:09:55 +00:00
parent 566446d77e
commit 6ba20772ae
3 changed files with 11 additions and 4 deletions

View file

@ -41,6 +41,8 @@
#include "htsmsg_binary.h"
static void *htsp_server;
#define HTSP_PROTO_VERSION 2
#define HTSP_PRIV_MASK (ACCESS_STREAMING)
@ -898,7 +900,7 @@ htsp_serve(int fd, void *opaque, struct sockaddr_in *source)
void
htsp_init(void)
{
tcp_server_create(9982, htsp_serve, NULL);
htsp_server = tcp_server_create(9982, htsp_serve, NULL);
}
/**

View file

@ -36,6 +36,7 @@
#include "http.h"
#include "access.h"
static void *http_server;
static LIST_HEAD(, http_path) http_paths;
@ -779,5 +780,5 @@ http_serve(int fd, void *opaque, struct sockaddr_in *source)
void
http_server_init(void)
{
tcp_server_create(9981, http_serve, NULL);
http_server = tcp_server_create(9981, http_serve, NULL);
}

View file

@ -34,7 +34,6 @@
#include "xmltv.h"
#include "spawn.h"
/**
*
*/
@ -517,13 +516,18 @@ void
xmltv_init(void)
{
pthread_t ptid;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
xmltv_grab_interval = 12; /* Default half a day */
xmltv_grab_enabled = 1; /* Default on */
/* Load all channels */
xmltv_load();
pthread_create(&ptid, NULL, xmltv_thread, NULL);
pthread_create(&ptid, &attr, xmltv_thread, NULL);
}