Memory allocation/deallocation with gSOAP
...I hope I've gotten the right list for this kind of question and I
want to apologies in advance if I'm wrong.
I'm new to soap and in a project using gSOAP (with c++ under win32,
just in case that matters), I've got to collect data from several
remote sources and deliver them in kind of digest containing
different data types (including pointers in several levels of
inference) to a client - all by soap.
When using temporary (local) varables, either with soap_malloc( soap*
pSOAP, ... ) or soap_new_CLASSNAME( soap* pSOAP, ... ) and copying
the data between the different message-objects, I often get
exceptions when leaving the method - in fact, while the first
deallocation is done without problems, afterwards the pointer to the
soap-object itself (pSOAP above) is invalid; btw. all message-objects
referred to the very same soap-object.
Furthermore, this behavoir seens unaffected by any attempts to
manually free the memory by soap_delete_...
Maybe somebody on this list could give me a short 'rule-of-the-thumb'
about what to use and what to stay away from in therms of memory
allocation/deallocation or point me to a comprehensive document about
this topic on the web?
A commented piece of correct code (just creating several message-
objects with soap, transferring data between them and correctly
freeing the memory afterwards) as an example would be a great help.
Since I'ld love to be away from office during the holidays, any fast
helping hand would really be appreciated.
thanks in advance and merry christmas,