config: stop leaking memory on config reload
On 02/25/2011 05:55 PM, Lon Hohberger wrote:
> On Thu, Feb 24, 2011 at 03:09:32PM +0100, Fabio M. Di Nitto wrote:
>> Resolves: rhbz#680155
> ACK, but seriously, a function called "xmlCleanupParser()" shouldn't
> leak memory ...
I think the problem is triggered by the fact that initial load of config
is done in the main thread, while subsequent reloads are done in another
thread. libxml2 is said to be thread friendly only under certain
circumstances and it's not completely tested for it. The documentation
does mention that and since we don't really have a need to use the whole
thread code here, let's take the easy approach.
In my tests, where i was calling only xmlCleanupParser, it was not
leaking at all. The leak happens only when there is an xmlParseFile and
xmlFreeDoc associated with it. Weird but well....