Many Web Services Client for C++ methods
either expect or create memory objects. There are a number of rules relating
to memory objects that you must follow when developing web
service client applications.
Below is a list of rules that you must follow when you are developing
applications:
- Any memory object that is passed to Web Services Client for C++ does
not need to persist past the method for which it was required and should be
deleted at the earliest opportunity.
- Any memory object created and returned by Web Services Client for C++ should
be deleted by the client application before the deletion of the web service
that created it. Note that Windows requires
that the memory object be deleted from within the thread that created it,
otherwise you may get an out of bounds exception type error from the core C++ libraries.
- Any object passed by reference (rather than value) that is used by Web Services Client for C++ must be created
using new, and destroyed using delete.
- Once an object has been deleted, its pointer must be set to NULL (this
is to ensure that the pointer is not used elsewhere).