It's necessary to do serious checks for the memory leaks using
tools like valgrind. This patch tries to implement a graceful
exit for all tvheadend components and free allocated memory.
Also, some memory leaks were fixed.
This breaks if, like me, you're using a proxy (or browser) which doesn't
support persitent connections, since you just get a constant reloading
of the UI! Will have to re-think, since ultimately what I really want is
to know user auth's within the UI, so possibly that will be easier when
we do away with HTTP Basic Auth, but also probably require restructuring
of this code.
This will indiscrimately include all HTSP and HTTP connections, first pass
I was going to just dump the lot on a UI status tab. However it could be
some filtering might be useful.
Many of these are somewhat redundant now, as I've suppressed many of the
warnings as they're false positives. However the changes, such as added
a detach flag to tvhthread_create(), have been kept anyway.
src/tcp.c:38: error: 'AF_INET' undeclared here (not in a function)
src/tcp.c:99: error: 'SOCK_STREAM' undeclared (first use in this function)
src/tcp.c:121: error: 'AF_INET6' undeclared (first use in this function)
src/tcp.c:159: error: 'SOL_SOCKET' undeclared (first use in this function)
src/tcp.c:159: error: 'SO_ERROR' undeclared (first use in this function)