Hi,
 i have here a small snippet of code which simulates the problem i am
facing.

                XMLCh *tlocal;
                tlocal = XMLString::transcode("This is a test");
                char *c = XMLString::transcode(tlocal);
Problem -->     delete [] c;

The problem occurs when i try to free the char c. As i am calling this
transcode function a lot of times in my program, i need to free it, but it
gives me an exception whenever i try to do so.
Any ideas would be highly appreciated.

Program included below.
Thanks.

///Code

#include <iostream.h>
#include <string.h>
#include <stdlib.h>
#include <util/PlatformUtils.hpp>
#include <util/XMLString.hpp>
#include <util/XMLUniDefs.hpp>

int main(int argc, char* argv[]) {
        int retval = 0;
    try {
                XMLPlatformUtils::Initialize();
        }
        catch (const XMLException& toCatch) {
        char *pMessage = XMLString::transcode(toCatch.getMessage());
        delete [] pMessage;
        return -1;
    }

        XMLCh *tlocal;
        tlocal = XMLString::transcode("This is a test");

        char *c = XMLString::transcode(tlocal);
        delete [] c;

    // And call the termination method
    XMLPlatformUtils::Terminate();
    return retval;
}
///Code




Mohammed Zubair V
MediaSoft Lab, Sony.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to