You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "nadir amra (JIRA)" <ax...@ws.apache.org> on 2007/04/12 22:41:15 UTC

[jira] Assigned: (AXISCPP-989) Memory leak in Clients after arrays are serialized

     [ https://issues.apache.org/jira/browse/AXISCPP-989?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

nadir amra reassigned AXISCPP-989:
----------------------------------

    Assignee: nadir amra

> Memory leak in Clients after arrays are serialized
> --------------------------------------------------
>
>                 Key: AXISCPP-989
>                 URL: https://issues.apache.org/jira/browse/AXISCPP-989
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Serialization
>    Affects Versions:  1.6 Final
>         Environment: Observed on Linux and Solaris. 
>            Reporter: Niall Kelly
>         Assigned To: nadir amra
>
> When an array of elements is serialized on the client side prior to invoking an operation, memory is leaked.
> In the SoapSerializer::addOutputCmplxArrayParam method, the pArray argument is cloned (pLocalArray), after which the clone is used as an argument of makeArrayBean. The internal array associated with the clone is then "de-coupled" before pLocalArray is destroyed. At this point the new ArrayBean object assumes ownership for the array memory.
> At some point after serialization the ArrayBean object is destroyed. However it's constructor does not delete the memory associated with the array and the elements it contains. In the extract below from ~ArrayBean, the check for AxisEngine::m_bServer prevents the array from being deleted (for applications on the client side).
>     // Extract from ~ArrayBean
>     if (USER_TYPE == m_type)
>     {
>         if (m_value.cta)
>         {
>             if (m_value.cta->pObject)
>             {
>               if (AxisEngine::m_bServer)
>                 {
>                     m_value.cta->pDelFunct(m_value.cta->pObject, true,
> m_nSize);
>                 }
>                 // make sure that the ComplexObjectHandler's destructor does
>                 // not try to delete the objects again 
>                 m_value.cta->pObject = NULL;
>             }
>             delete m_value.cta;
>             m_value.cta = NULL;
>         }
>     }
> Perhaps this memory leak can be fixed by simple removing that check for AxisEngine::m_bServer and always invoking m_value.cta->pDelFunct (i.e. the appropriate genereted delete method..).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org