Share

TinyXPath : tiny C++ XPath

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Memory leak in er_compute_xpath

You are viewing a single message from this topic. View all messages.

  1. 2009-06-09 04:15:37 UTC
    I haven't gone deeper in my debugging but I can definitely say that there is a memory leak being created when calling TinyXPath::xpath_processor::er_compute_xpath() from within S_compute_xpath().

    I'm not sure if I am just invoking it wrong but here is an overview of how I use TinyXPath...

    // CODE: START
    std::string xmlstr;
    // xmlstr = some valid XML string

    std::string xpathstr;
    // xpathstr = some valid xpath string

    TiXmlDocument doc;
    doc.Parse( xmlstr.str());

    if( doc.Error()) return "";

    TinyXPath::xpath_processor x( doc.RootElement(), xpathstr );
    std::string ret=x.S_compute_xpath().c_str();

    return ret;
    // CODE: END

    Is there any free/delete function I should be calling?

    Thanks in advance!

    John
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.