diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 36e9751186..b66d7caed0 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,13 @@ +2000-06-29 10:50 UTC+0100 Ryszard Glab + + *source/vm/classes.c + *fixed to stop handling of the garbage collector requests + (hb_clsIsClassRef()) after all classes were released + + *source/rtl/setkey.c + *fixed to lock codeblocks stored internally to prevent deallocation + by the garbage collector + 2000-06-28-23:20 Luiz Rafael Culik *contrib/hbzlib/zipfile2.c -hb___MyMkdir() Functions. All Calls to this function replaced with hb_fsMkDir() diff --git a/harbour/source/rtl/setkey.c b/harbour/source/rtl/setkey.c index fdf0db605a..25777aee8e 100644 --- a/harbour/source/rtl/setkey.c +++ b/harbour/source/rtl/setkey.c @@ -65,10 +65,13 @@ void hb_setkeyExit( void ) { PHB_SETKEY sk_list_tmp; + hb_gcUnlockItem( s_sk_list->pAction ); hb_itemRelease( s_sk_list->pAction ); if( s_sk_list->pIsActive ) + { + hb_gcUnlockItem( s_sk_list->pIsActive ); hb_itemRelease( s_sk_list->pIsActive ); - + } sk_list_tmp = s_sk_list->next; hb_xfree( ( void * ) s_sk_list ); s_sk_list = sk_list_tmp; @@ -106,6 +109,10 @@ static void sk_add( BOOL bReturn, SHORT iKeyCode, PHB_ITEM pAction, PHB_ITEM pIs sk_list_tmp->iKeyCode = iKeyCode; sk_list_tmp->pAction = hb_itemNew( pAction ); sk_list_tmp->pIsActive = pIsActive ? hb_itemNew( pIsActive ) : NULL; + /* lock codeblock to prevent deallocation by the GC */ + hb_gcLockItem( sk_list_tmp->pAction ); + if( sk_list_tmp->pIsActive ) + hb_gcLockItem( sk_list_tmp->pIsActive ); if( sk_list_end == NULL ) s_sk_list = sk_list_tmp; @@ -122,16 +129,23 @@ static void sk_add( BOOL bReturn, SHORT iKeyCode, PHB_ITEM pAction, PHB_ITEM pIs /* Free the previous values */ + hb_gcUnlockItem( sk_list_tmp->pAction ); hb_itemRelease( sk_list_tmp->pAction ); if( sk_list_tmp->pIsActive ) + { + hb_gcUnlockItem( sk_list_tmp->pIsActive ); hb_itemRelease( sk_list_tmp->pIsActive ); - + } /* Set the new values or free the entry */ if( pAction ) { sk_list_tmp->pAction = hb_itemNew( pAction ); sk_list_tmp->pIsActive = pIsActive ? hb_itemNew( pIsActive ) : NULL; + /* lock codeblock to prevent deallocation by the GC */ + hb_gcLockItem( sk_list_tmp->pAction ); + if( sk_list_tmp->pIsActive ) + hb_gcLockItem( sk_list_tmp->pIsActive ); } else { diff --git a/harbour/source/vm/classes.c b/harbour/source/vm/classes.c index ec26f8b685..ecf1c084e8 100644 --- a/harbour/source/vm/classes.c +++ b/harbour/source/vm/classes.c @@ -316,6 +316,8 @@ void hb_clsReleaseAll( void ) if( s_pClasses ) hb_xfree( s_pClasses ); + s_uiClasses = 0; + s_pClasses = NULL; } /* Check if passed memory block pointer is referenced by some class