Przemyslaw Czerpak wrote:
Poiters cannot be indirectly unlocked during hb_itemPutPtrGC because
using the following code:
HB_ITEM item;
item.type = HB_IT_NIL;
hb_itemPutPtrGC( &item, hb_gcAlloc( size, someFunc ) );
will end with an item storing an unlocked pointer that will be
released prematurely by the GC.
1-st it's a code example I'm fighting to eliminate: code which creates
unknown for GC C level items. In last years I spent to much time helping
different people in locating bugs caused by such code.
Hi,
I have an idea - temporarily add a call to function
void hb_gcGripTest( PHB_ITEM pItem )
{
HB_GARBAGE_PTR pAlloc = HB_GC_PTR( pItem );
if( pAlloc->pFunc != hb_gcGripRelease )
hb_errInternal( HB_EI_XREALLOCNULL, NULL, NULL, NULL );
}
from for example hb_itemClear() and hb_itemCopy().
Best regards,
Mindaugas
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour