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.
I started to do this as there was a possible issue with imagecache as a result
of updates. However this has thus far not been proved, but still a useful
update. Hopefully not too broken!
This is because the field can now be NULL and there were places where this
was not properly checked. So now a function call channel_get_name() should
be used instead and is garaunteed to return non-NULL.
In addition to this there is a nice added benefit. You can NOT set the name,
and it will automatically pull the name from the first available service. This
will not be persistent (part of config) unless you change that name and save
from the UI. This means if the service name changes, so will the channel name.
However on that last point there will not be, currently, any message sent to
the clients (HTSP) to inform them of such a change. So there might be some lag
in getting the update.
This can be done in 3 ways:
none: don't hide anything
all: hide all disabled elements (you can't re-enable in this state)
default: hide those elements whose parents are disabled
This had been left out for too long and makes it awkward for novices
to setup the networks. The config is possibly not as nice as before where
it was presented as a tree. But this can be improved later.
The API code has also been updated to use the htsmsg auto conversion of
strings to map/list where required. Basic approach is check for list/map
first and if that fails fallback to string (if that's whats appropriate
for a mixed type field).