axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Susantha Kumara <>
Subject Re: [Fwd: Re: Problems with deleting void*]
Date Wed, 22 Dec 2004 04:23:33 GMT
Samisa Abeysinghe wrote:

>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.
Briefly described in AxisWrapperAPI.hpp.

Anyway AXIS_OBJECT_DELETE_FUNCT treats void* as an array of particular 
type for deleting if bArray is true.


>On Tue, 21 Dec 2004 11:15:11 +0600, Susantha Kumara
><> 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
>><> 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 <> 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; } } 

View raw message