views:

163

answers:

2

I am using libxml2 to parse xml content in my iPhone app. The xml content is downloaded from a server similar to the Apple's own TopSongs sample app. When I check for leaks using the Instruments tool, I see memory leaks being reported on xmlNewParserCtxt, xmlNewInputStream and xmlAllocParserInputBuffer. I have called xmlFreeParserCtxt(context) at applicable places (dealloc).

Am I missing something else ? Is this a known issue to contend with when using libxml2 parsers ?

A: 

I don't know enough to go into detail about the SDK, but I often get "memory leaks" from the SDK libraries. There is nothing you can do to correct things in the compiled libraries, however.

What I experience is that if there are any leaks in your code, it can often manifest itself as leaks in the API's you call from your leaky code. (Like if you pass a delegate to an SDK API, then the SDK ends up calling your leaky code using that delegate). Usually I ignore it until it is time to optimize the application and when doing so, removing my own leaks, usually make the SDK leaks also disappear.

RickiG
A: 

Thanks for your response.

KSH