[mythtv] possible filter manager leak

Erik Hovland erik at hovland.org
Sat Mar 15 01:08:31 UTC 2008

On Fri, Mar 14, 2008 at 11:35:41AM -0500, Andy Poling wrote:
> On Sat, 15 Mar 2008, Mark Spieth wrote:
> > Im not sure what the intention is with filter management, but in
> > filtermanager
> > the libs opened with LoadFilterLib's dlopen are not dlclosed at any time.
> > This happens via the constructor of the filter manager. This also dlopens
> > all filters every time. I found this because I was chasing a deadlock inside
> > dlopen on play start which ended up being mythphone's fault (no mythphone,
> > no deadlock :-).
> >
> > when a filter is used, it is dlopened again, and when done dlclosed but only
> > those that are used. so this part is good.
> >
> > I may be wrong, but I suspect this is a handle leak.
> > What was the intention?
> > I would have thought a filter cache after they are all loaded and thus dont
> > need to be loaded again, nor unloaded.
> According to the man page, additional calls to dlopen() for any library will
> simply return the same handle as was already obtained the first time, and it
> is not de-allocated until dlclose() is called as many times as dlopen()...
> which seems not to be happening by design.
> From my reading, that means that we'll always have each filter linked in, but
> only once and with one handle.  It sounds to me like there's nothing wrong
> with the code as-is (until we have way more filters than we presently have).

Agreed. As far as leaks go, this is a real minor one. But hey, why have


Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request

More information about the mythtv-dev mailing list