RE: [xml] Segmentation fault in xmlFreeDoc



Hi, 

-----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On 
Behalf Of Chidanand Gangur

[...]

        DPRINTF("\nError: Empty Document\n");
        xmlFreeDoc(doc);
        xmlCleanupParser();
        return 1;

[...]

    xmlFreeDoc(doc);   /*crash happens here*/ 
    xmlCleanupParser();
    return SUCCESS;

The problem you have seems to be related to the call to
xmlCleanupParser().
This function is intended to be called only at the end of usage of the
whole library; it cleans up globally allocated memory. The name of the
function is a bit misleading. Just don't use it there and use it once
at the end of your app.

Regards,

Kasimier



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