I'm quite sure I don't understand the context of this change, but
looking at the code makes me wonder why std::vector isn't being used.
std::vector will handle resizing and copying automatically. 

What am I missing?

 ...Duane

--- At Tue, 18 Oct 2005 07:57:45 +0200, nadir amra (JIRA) wrote:

>    [ http://issues.apache.org/jira/browse/AXISCPP-343?
>page=comments#action_12332324 ] 
>
>nadir amra commented on AXISCPP-343:
>------------------------------------
>
>OK, I am currently testing a fix that seems to be working.  Will put
>into repository tomorrow if further testing does not come up with anything.
>
>My solution was to generate a reset() method that contains the code that
>was originally in the constructor.  The constructor now calls reset().  
>
>So when arrays are made bigger, the generated code now looks like the
>following (taking AxisBench as an example):
>
>                       BenchBasicDataType* pNew = new 
> BenchBasicDataType[nSize];
>                       size_t i = nSize/2;
>                       for (int ii=0; ii<i; ++ii)
>                       {
>                               pNew[ii] = pObj[ii];
>                               pObj[ii].reset();
>                       }
>                       delete [] pObj;
>                       return pNew;
>
>This performs bitwise-copies of data items, then resets the copied
>object so that the fields in the source array are reinitialized in the
>same way as when the object is instantiated.
>
>Let me know if you see any wholes...and I will let you know when I
>commit the code to the repository.
>
>> SIGSEGV deserializing an array of complex elements
>> --------------------------------------------------
>>
>>          Key: AXISCPP-343
>>          URL: http://issues.apache.org/jira/browse/AXISCPP-343
>>      Project: Axis-C++
>>         Type: Bug
>>   Components: Serialization
>>     Versions: 1.4 Final
>>  Environment: RH9
>>     Reporter: Unai Uribarri
>>      Fix For: 1.6 Alpha
>>  Attachments: siaam.wsdl
>>
>> The function Axis_Create_* (in the following example, the mapItem
>> object) in the stubs generated by wsdl2ws java tool generates a SIGSEGV
>> when tring to enlarge an array of objects
>>         mapItem* pNew = new mapItem[nSize];
>>         memcpy(pNew, pObj, sizeof(mapItem)*nSize/2);
>>         memset(pObj, 0, sizeof(mapItem)*nSize/2);
>>         --> delete [] pObj; <-- SIGSEGV
>> memset clears the virtual table pointer of the mapItem objects and the
>delete operator crash.


Reply via email to