Hi again
I'm trying to solve the problem with the memory
leak on the client side of axis library.
I've next function which is called in multithreaded
way:
setReturnAddPointsParameter* pRAPP = NULL;
MPBLPSoap pBLP_authorize(sMPG.strURL.c_str(), APTHTTP1_1); pBLP_authorize.Timeout(10); pRAPP = pBLP_authorize.AddPoints(1,string_number,double_value); pRAPP is structure with next
parameters:
xsd__string sBlpType;
xsd__double dAmount; xsd__string lTransactionID; The problem is how to delete allocated space for
these parameters when I don't needed it any more. There is defined delete
function
Axis_Delete_setReturnAddPointsParameter which is defined:
void
Axis_Delete_setReturnAddPointsParameter(setReturnAddPointsParameter* param, bool
bArray = false, int nSize=0)
{ if (bArray) delete [] param; else delete param; } So I called this function when I want to delete
allocated memory for parameters. This function calls destructor:
setReturnAddPointsParameter::~setReturnAddPointsParameter()
{ }
which is empty. If I use statements delete or free
inside destructor I get the following error "User breakpoint called from code at
***".
So I checked how are basic types defined
(xsd_string, xsd_double). They are defined as
classes and their destructors are empty. If I put delete statements into these
destructors then the result structure pRAPP is empty, because parameters
are deleted before they can be used (destructor is called after calling this
method: xsd__string
SoapDeSerializer::getElementAsString (const AxisChar * pName, const AxisChar * pNamespace). So is it possible to delete allocated memory or is there a problem in design
structure of axis library? I mean is it possible to delete allocated memory for
basic type classes? Is solution in defining some extra methods which they have
access to those classes and they include delete statement?
Best regards
Tomaz
|