diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 16e2ac86b4..a9a9b632cf 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,8 @@ +19990522-17:50 CET Eddie Runia + * source/rtl/arrays.c, source/rtl/classes.c + typical : if it works on one compiler, it will fail on another. + oClone also modified :-) + 19990522-17:25 CET Eddie Runia * source/vm/hvm.c 'Array' bug possibly resolved. diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index 4c3087dceb..25f0100400 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -544,9 +544,9 @@ PITEM hb_arrayClone( PITEM pSrcArray ) PITEM pSrcItem = pSrcBaseArray->pItems + ulCount; if ( pSrcItem->wType == IT_ARRAY ) - hb_itemArrayPut( pDstArray, ulCount, hb_arrayClone( pSrcItem ) ); + hb_itemArrayPut( pDstArray, ulCount + 1, hb_arrayClone( pSrcItem ) ); else - hb_itemArrayPut( pDstArray, ulCount, pSrcItem ); + hb_itemArrayPut( pDstArray, ulCount + 1, pSrcItem ); } return pDstArray; } @@ -687,6 +687,8 @@ HARBOUR ACLONE( void ) { PITEM pDstArray = hb_arrayClone( pSrcArray ); ItemCopy( &stack.Return, pDstArray ); /* AClone() returns the new array */ + ItemRelease( pDstArray ); + _xfree( pDstArray ); } else _ret(); diff --git a/harbour/source/rtl/classes.c b/harbour/source/rtl/classes.c index 9ba3d4e2d4..af3196d4ed 100644 --- a/harbour/source/rtl/classes.c +++ b/harbour/source/rtl/classes.c @@ -684,6 +684,8 @@ HARBOUR OCLONE( void ) { PITEM pDstObject = hb_arrayClone( pSrcObject ); ItemCopy( &stack.Return, pDstObject ); /* OClone() returns the new object */ + ItemRelease( pDstArray ); + _xfree( pDstArray ); } else _ret();