axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <samisa.abeysin...@gmail.com>
Subject Re: [Fwd: Re: Problems with deleting void*]
Date Tue, 21 Dec 2004 10:57:50 GMT
Oh I did not know that. Is this documented anywhere. BTW, how do we
delete an array with this? Treat array as an object I guess.

Samisa...


On Tue, 21 Dec 2004 11:15:11 +0600, Susantha Kumara
<susantha@opensource.lk> wrote:
>  Hi Samisa
>  
> 
>  Well this is not about cleaning returned arrays. The error appears in
> places, where the already allocated memory is cleaned in case of returning
> an empty array when an error is encountered. We need to have some fix for
> this to gauard against memory leaks. Samisa... Yes from within Axis we
> ALWAYS allocate complex objects using AXIS_OBJECT_CREATE_FUNCT function and
> they should ALWAYS be deallocated using AXIS_OBJECT_DELETE_FUNCT function. 
>  
>  Regards,
>  
>  Susantha..
> 
>  
>  
>  On Mon, 20 Dec 2004 17:44:00 +0600, Susantha Kumara
> <susantha@opensource.lk> wrote: 
>  Samisa Abeysinghe wrote: I dont get this. Then would not there be a memory
> leak? Samisa... On Mon, 
>  20 Dec 2004 17:24:53 +0600, Susantha Kumara <susantha@opensource.lk> wrote:
>  Samisa Abeysinghe wrote: 
>  Hi All, In the SoapDeSerializer class, I get the following warning 
>  when compiling. I fixed similar warnings at other places in the same 
>  class prior to the release of 1.4 Alpha, but could not fix these few, 
>  as there is no knowlege of the types that we are dealing with in 
>  this scope. The warning is as follows: SoapDeSerializer.cpp: In member 
>  function `virtual axiscpp::Axis_Array
> axiscpp::SoapDeSerializer::getCmplxArray(void*, void*, void*, void*, const
> char*, const char*)': SoapDeSerializer.cpp:606: warning: deleting `void*' is
>  undefined SoapDeSerializer.cpp:631: warning: deleting `void*' is 
>  undefined SoapDeSerializer.cpp:672: warning: deleting `void*' is 
>  undefined I think it is importat to fix this, as even though it is a 
>  warning, it says, "deleting `void*' is undefined". This may well mean that 
>  the runtime is not doing anything (or may be the compiler is fooling us ;-)
>  ) Any ideas on how to fix this? Thanks, Samisa... Could you please 
>  use following 3 lines ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) 
>  (Array.m_Array, true, Array.m_Size); Array.m_Array = 0; Array.m_Size = 
>  0; instead of , delete[]Array.m_Array; Array.m_Size = 0; That is the 
>  intended way to deallocate any memory of complex type objects allocated 
>  using AXIS_OBJECT_CREATE_FUNCT. Thanks, Susantha. No. 
>  ((AXIS_OBJECT_DELETE_FUNCT) pDelFunct) (Array.m_Array, true, Array.m_Size);
> function calls the generated delete method of the type's 
>  wrapper where this array is deleted properly. see the delete function of 
>  SOAPStruct: /* 
>  * This static method delete a SOAPStruct type of object */ void
> Axis_Delete_SOAPStruct(SOAPStruct* param, bool bArray = false, int nSize=0)
> { if (bArray) { delete [] param; //array is deleted here } else { delete
> param; } } 
>

Mime
View raw message