Re: [xml] xmlFreeDoc() on iOS 4 - crashes



On 10/13/2010 23:54, Chi Yin Luk wrote:

I am using libxml2.2.7.3.dylib on my iPhone application.

The application is targeting iOS 3.2, but the xmlFreeDoc() fails when the application is running on iPhone 4, but not on iOS 3.2 or before.

I also tried targeting iOS 4 and running on iPhone 4, same problem exist.

 

The problem is if I assign the encocoding of xmlDocPtr , then call xmlFreeDoc to free the xmlDocPtr, it crashes with message:

pointer being freed was not allocated

 

 

The snippet of code as follow:

 

xmlDocPtr doc;

 

doc = xmlNewDoc((cost xmlChar*)XML_DEFAULT_VERSION);

doc->encoding =”utf-8”;

xmlFreeDoc(doc);

This only means that iOS 4th reports failure better. You're doing a xmlFree on some static address.

 

 

I free the document right after the creation of xmlDocPtr just to demonstrate the encoding is causing the problem.

 

 

 

Thanks,

Chi Yin Luk




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