You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Tom Alexandrowicz <so...@kill.us> on 2004/03/24 19:26:44 UTC

Memory management semantics in Axis

I wonder about the semantics of some of the Axis calls...

For example Call::SetEndpointURI(const char *pchEndpointURI)

If I call Call::SetEndpointURI and pass in a string, am I making a deal with
the Call object that that the memory pointed at by the char* I passed in
will stick around until I'm done with the Call?

For example, should I be able to do this?
{
    char* x = new char[200];
    strcpy(x, "http://localhost");

    Call call;
    call.SetEndpoint(x);

    delete x;

    call.Initialize(...)
}

If this is supposed to be allowed then it is a bug that Call::SetEndpointURI
doesn't copy the string it gets...