[ 
http://issues.apache.org/jira/browse/AXISCPP-507?page=comments#action_60351 ]
     
Samisa Abeysinghe commented on AXISCPP-507:
-------------------------------------------

Hi Adrian,
    I too agree that, given the short life, if we are to clean memory in the 
destructor, it complicates the issues.
    Hence the best would be to delete the memory at stub level, in which case, 
we may need to make a copy of the value of the pointer and delete the memory in 
generated code, and leave the destructor empty.

     Implementing the more cleaner model of destructor releasing memory at this 
point is a bit risky as it would trigger changes at multiple places of the code.

> Memory leaks in deserialize methods of XSD classes (in src/soap/xsd)
> --------------------------------------------------------------------
>
>          Key: AXISCPP-507
>          URL: http://issues.apache.org/jira/browse/AXISCPP-507
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Samisa Abeysinghe
>      Fix For: 1.5 Final

>
> Deserialize method returns a pointer that is never deleted. The generated 
> code, dereferances the pointer and returns values to the Stub.
> Hence, the generated code should take care of the clearance of memeory.
> I tried to release this  memeory in the destructor of the XSD class, but then 
> by the time the generated code tries to access the value, the pointer is no 
> more. This leaves the only option of deleting the memory returned in the 
> generated code where it invokes the respective method.
> Alternatively, we can make the XSD class manage its own memory and let the 
> code accessing the memory make a deep copy of the returned pointer (that is 
> generated code)
> Whateve the fix would be, it needs changes to code generator.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira

Reply via email to