2000-09-20 11:20 UTC+0800 Brian Hays <bhays@abacuslaw.com>
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
source\rdd\dbf1.c
|
||||
!removed reference to unknown pItem in HB_TRACE for hb_dbfUnlockAllRecords
|
||||
doc/en/garbage.txt
|
||||
minor grammar fixes
|
||||
source/rdd/workarea.c
|
||||
added Item lock/unlock to SetFilter/Clearfilter so GC won't
|
||||
de-allocate the codeblock
|
||||
(fixes error at close of app for a bad pointer in hb_xfree)
|
||||
|
||||
2000-09-20 13:12 GMT+3 Alexander Kresin <alex@belacy.belgorod.su>
|
||||
* source/rdd/workarea.c
|
||||
* include/hbrddwrk.h
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
* doesn't know their location. This could cause some memory blocks to be
|
||||
* released prematurely. To prevent the premature deallocation of such memory
|
||||
* blocks they have to be locked for the garbage collector. The memory block
|
||||
* can be locked with hb_gcLockItem() (recommendeed method) if
|
||||
* can be locked with hb_gcLockItem() (recommended method) if
|
||||
* harbour item structure is used or hb_gcLock() function if a direct memory
|
||||
* pointer is used. The memory block can be unlocked by hb_gcUnlockItem() or
|
||||
* hb_gcUnlock().
|
||||
|
||||
@@ -262,7 +262,7 @@ static void hb_dbfUnlockAllRecords( DBFAREAP pArea )
|
||||
{
|
||||
ULONG ulCount;
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_dbfUnlockAllRecords(%p, %p)", pArea, pItem));
|
||||
HB_TRACE(HB_TR_DEBUG, ("hb_dbfUnlockAllRecords(%p, %p)", pArea ));
|
||||
|
||||
if( pArea->pLocksPos )
|
||||
{
|
||||
@@ -352,7 +352,7 @@ static ERRCODE hb_dbfLockRecord( DBFAREAP pArea, ULONG ulRecNo, BOOL * pResult,
|
||||
}
|
||||
else
|
||||
* pResult = FALSE;
|
||||
return SUCCESS;
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -492,7 +492,7 @@ static ULONG hb_dbfGetMemoLen( DBFAREAP pArea, USHORT uiIndex )
|
||||
uiIndex = 0;
|
||||
while( uiIndex < DBT_BLOCKSIZE && pBlock[ uiIndex ] != 0x1A )
|
||||
uiIndex++;
|
||||
ulBlock += uiIndex;
|
||||
ulBlock += uiIndex;
|
||||
} while( uiIndex == DBT_BLOCKSIZE );
|
||||
return ulBlock;
|
||||
}
|
||||
@@ -1955,7 +1955,7 @@ ERRCODE hb_dbfPack( DBFAREAP pArea )
|
||||
hb_vmPush( pBlock );
|
||||
hb_vmDo( 0 );
|
||||
}
|
||||
|
||||
|
||||
pArea->ulRecCount = ulRecOut;
|
||||
return hb_dbfGoTo( pArea, 1 );
|
||||
}
|
||||
@@ -2243,17 +2243,17 @@ ERRCODE hb_dbfLock( DBFAREAP pArea, LPDBLOCKINFO pLockInfo )
|
||||
switch( pLockInfo->uiMethod )
|
||||
{
|
||||
case DBLM_EXCLUSIVE:
|
||||
return hb_dbfLockRecord( pArea, pArea->ulRecNo, &pLockInfo->fResult,
|
||||
return hb_dbfLockRecord( pArea, pArea->ulRecNo, &pLockInfo->fResult,
|
||||
( pLockInfo->uiMethod == DBLM_EXCLUSIVE ) );
|
||||
|
||||
|
||||
case DBLM_MULTIPLE:
|
||||
return hb_dbfLockRecord( pArea, hb_itemGetNL( pLockInfo->itmRecID ),
|
||||
&pLockInfo->fResult,
|
||||
&pLockInfo->fResult,
|
||||
( pLockInfo->uiMethod == DBLM_EXCLUSIVE ) );
|
||||
|
||||
|
||||
case DBLM_FILE:
|
||||
return hb_dbfLockFile( pArea, &pLockInfo->fResult );
|
||||
|
||||
|
||||
default:
|
||||
pLockInfo->fResult = FALSE;
|
||||
}
|
||||
@@ -2484,11 +2484,11 @@ HB_FUNC( DBF_GETFUNCTABLE )
|
||||
uiCount = ( USHORT * ) hb_itemGetPtr( hb_param( 1, HB_IT_POINTER ) );
|
||||
* uiCount = RDDFUNCSCOUNT;
|
||||
pTable = ( RDDFUNCS * ) hb_itemGetPtr( hb_param( 2, HB_IT_POINTER ) );
|
||||
|
||||
|
||||
HB_TRACE(HB_TR_DEBUG, ("DBF_GETFUNCTABLE(%i, %p)", uiCount, pTable));
|
||||
|
||||
if( pTable )
|
||||
hb_retni( hb_rddInherit( pTable, &dbfTable, &dbfSuper, 0 ) );
|
||||
else
|
||||
hb_retni( FAILURE );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -737,6 +737,7 @@ ERRCODE hb_waClearFilter( AREAP pArea )
|
||||
/* Free all items */
|
||||
if( pArea->dbfi.itmCobExpr )
|
||||
{
|
||||
hb_gcUnlockItem(pArea->dbfi.itmCobExpr);
|
||||
hb_itemRelease( pArea->dbfi.itmCobExpr );
|
||||
pArea->dbfi.itmCobExpr = NULL;
|
||||
}
|
||||
@@ -820,7 +821,10 @@ ERRCODE hb_waSetFilter( AREAP pArea, LPDBFILTERINFO pFilterInfo )
|
||||
SELF_CLEARFILTER( pArea );
|
||||
|
||||
if( pFilterInfo->itmCobExpr )
|
||||
{
|
||||
pArea->dbfi.itmCobExpr = hb_itemNew( pFilterInfo->itmCobExpr );
|
||||
hb_gcLockItem(pArea->dbfi.itmCobExpr);
|
||||
}
|
||||
|
||||
if( pFilterInfo->abFilterText )
|
||||
pArea->dbfi.abFilterText = hb_itemNew( pFilterInfo->abFilterText );
|
||||
|
||||
Reference in New Issue
Block a user