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: choice does not work?
Date Thu, 10 Nov 2005 01:33:46 GMT
John Hawkins wrote:

>
> Hi Folks,
>
> In the reset() method of a choice type we do the following ->
>
> /*do not allocate memory to any pointer members here
>          because deserializer will allocate memory anyway. */
>         memset( &a, 0, sizeof( xsd__string));
>         memset( &b, 0, sizeof( xsd__int));
>         memset( &c, 0, sizeof( xsd__dateTime));
>
> Now, I see the commment but this doesn't work when the type is an 
> input i.e. not created by the deserialiser the destructor does not work.
>
> Can anyone tell me why we do this and not just ->
> a=0;
> b=0;
> c=0;
>
> (which works for me)
>
I too am not sure whay memset was used here. I tried setting the members 
NULL as you have done some time back and seem to work. But did not 
change memset as I was not sure why it was used.

The original idea of using memset seem to come from 
http://issues.apache.org/jira/browse/AXISCPP-186

Thanks,
Samisa...

> thanks,
> John. 



Mime
View raw message