Menu

Loading from a buffer with Parse()

Marat G
2008-04-26
2013-05-20
  • Marat G

    Marat G - 2008-04-26

    Hello,
    I have a question about using the Parse() API.
    I'm using TinyXML on a WinCE 5.0 device and loading XML from memory, rather than from a file. My question is - do I need to keep the char buffer around after it has been parsed, or is it safe to delete [] it?

    Thanks.

     
    • Filipe

      Filipe - 2008-07-15

      There's no problem with this, when TinyXML is parsing the document, it make copies of each piece of data it needs... Actually the method LoadFile of TiXMLDocment creates a temporary buffer ( an automatic string ), calls Parse and then the string goes out of scope causing the data to be deleted from memory...

       

Log in to post a comment.