Re: [xml] Memory Leaks in parse3.c example



Chris Johnson wrote:

Thanks for the reply. I've done further testing and found some very interesting results as follows. It turns out when I compile and link parse3.c with static version of libxml purify turns up several memory leaks as shown in the attached a.out.static. Thinking the leaks are

I do not know why it behave differently in the static and shared
versions, so I will concentrate on the static version that has the
leaks. Furthermore, I do not have access to a Solaris machine at the
moment, so the following is deduced from reading the source code.

It appears that xmlNewGlobalState() is called many times instead of just
once. Can you confirm this? (this is probably easiest done by putting a
breakpoint in the function).

If so, then the problem may be related to the initialization of the
globalvar variable. What is the return value of phread_once() in
xmlGetGlobalState()? Is xmlOnceInit() called, and what is the return
value of pthread_key_create()?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]