You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-user@axis.apache.org by rh...@medialines.de on 2006/08/23 09:44:25 UTC
Where to deallocate memory for server-sided return values?
Hi,
can anybody tell me where i can deallocate allocated memory for
result-values (e.g. strings or ArrayOfStrings) on server side?
Or is this done by axis itself?
Example of such a server-side method:
ArrayOfstring* ServerSideClass::getStringList()
{
// Allocate memory:
ArrayOfstring* resultArray = new ArrayOfstring;
int resultArraySize = 3;
resultArray->item.m_Array = new xsd__string[resultArraySize];
resultArray->item.m_Size = resultArraySize;
// Fill the resultArray:
resultArray->item.m_Array[0] = "String1";
resultArray->item.m_Array[1] = "String2";
resultArray->item.m_Array[2] = "String3";
return resultArray;
// BUT WHERE TO DEALLOCATE THE resultArray ???
}
THANKS FOR ANY HELP!!
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org
Re: Where to deallocate memory for server-sided return values?
Posted by Adrian Dick <ad...@uk.ibm.com>.
Hi,
If you're using Axis C++ 1.6beta (or a more recent nightly build) the
combination of the Axis engine and generated server skeletons will ensure
the value returned from the service is deallocated.
Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)
<rh...@medialines.de> wrote on 23/08/2006 08:44:25:
> Hi,
>
> can anybody tell me where i can deallocate allocated memory for
> result-values (e.g. strings or ArrayOfStrings) on server side?
> Or is this done by axis itself?
>
> Example of such a server-side method:
>
> ArrayOfstring* ServerSideClass::getStringList()
> {
> // Allocate memory:
> ArrayOfstring* resultArray = new ArrayOfstring;
> int resultArraySize = 3;
> resultArray->item.m_Array = new xsd__string[resultArraySize];
> resultArray->item.m_Size = resultArraySize;
>
> // Fill the resultArray:
> resultArray->item.m_Array[0] = "String1";
> resultArray->item.m_Array[1] = "String2";
> resultArray->item.m_Array[2] = "String3";
> return resultArray;
>
> // BUT WHERE TO DEALLOCATE THE resultArray ???
> }
>
> THANKS FOR ANY HELP!!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org