diff --git a/harbour/source/vm/itemapi.c b/harbour/source/vm/itemapi.c index 50cd066171..77e8ea960a 100644 --- a/harbour/source/vm/itemapi.c +++ b/harbour/source/vm/itemapi.c @@ -919,6 +919,20 @@ PHB_ITEM hb_itemUnRef( PHB_ITEM pItem ) HB_TRACE(HB_TR_DEBUG, ("hb_itemUnRef(%p)", pItem)); while( HB_IS_BYREF( pItem ) ) + pItem = hb_itemUnRefOnce( pItem ); + + return pItem; +} + + +/* Internal API, not standard Clipper */ +/* De-references item passed by the reference */ + +PHB_ITEM hb_itemUnRefOnce( PHB_ITEM pItem ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_itemUnRefOnce(%p)", pItem)); + + if( HB_IS_BYREF( pItem ) ) { if( HB_IS_MEMVAR( pItem ) ) { @@ -958,6 +972,7 @@ PHB_ITEM hb_itemUnRef( PHB_ITEM pItem ) return pItem; } + /* Internal API, not standard Clipper */ /* Check whether two strings are equal (0), smaller (-1), or greater (1) */