From 13a99b967ff4a4158a89cdd2a396b97541eac55e Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Wed, 3 Nov 1999 06:37:20 +0000 Subject: [PATCH] *** empty log message *** --- harbour/include/extend.h | 3 --- harbour/source/rtl/arrays.c | 14 ++++++-------- harbour/tests/clasinh.prg | 24 ++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 11 deletions(-) create mode 100644 harbour/tests/clasinh.prg diff --git a/harbour/include/extend.h b/harbour/include/extend.h index b42c1e99b1..d24c1ca6d5 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -196,10 +196,8 @@ typedef struct _HB_BASEARRAY PHB_ITEM pItems; /* pointer to the array items */ ULONG ulLen; /* number of items in the array */ USHORT uiHolders; /* number of holders of this array */ - USHORT uiPrevHolders; /* for fixing after access super */ USHORT uiClass; /* offset to the classes base if it is an object */ USHORT uiPrevCls; /* for fixing after access super */ - BOOL bSuperCast; /* is it a super cast ? */ } HB_BASEARRAY, * PHB_BASEARRAY, * HB_BASEARRAY_PTR; /* stack managed by the virtual machine */ @@ -418,4 +416,3 @@ extern char * hb_version( USHORT uiMode ); #endif #endif /* HB_EXTEND_H_ */ - diff --git a/harbour/source/rtl/arrays.c b/harbour/source/rtl/arrays.c index 0675ef6b22..c96867c669 100644 --- a/harbour/source/rtl/arrays.c +++ b/harbour/source/rtl/arrays.c @@ -76,7 +76,7 @@ BOOL hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */ pBaseArray->ulLen = ulLen; pBaseArray->uiHolders = 1; pBaseArray->uiClass = 0; - pBaseArray->bSuperCast = FALSE; + pBaseArray->uiPrevCls = NULL; for( ulPos = 0; ulPos < ulLen; ulPos++ ) ( pBaseArray->pItems + ulPos )->type = IT_NIL; @@ -638,14 +638,12 @@ BOOL hb_arrayRelease( PHB_ITEM pArray ) ULONG ulLen = pBaseArray->ulLen; ULONG ulPos; - if( !pBaseArray->bSuperCast ) - { - for( ulPos = 0; ulPos < ulLen; ulPos++ ) - hb_itemClear( pBaseArray->pItems + ulPos ); + for( ulPos = 0; ulPos < ulLen; ulPos++ ) + hb_itemClear( pBaseArray->pItems + ulPos ); + + if( pBaseArray->pItems ) + hb_xfree( pBaseArray->pItems ); - if( pBaseArray->pItems ) - hb_xfree( pBaseArray->pItems ); - } hb_xfree( pBaseArray ); pArray->type = IT_NIL; diff --git a/harbour/tests/clasinh.prg b/harbour/tests/clasinh.prg new file mode 100644 index 0000000000..15f2868298 --- /dev/null +++ b/harbour/tests/clasinh.prg @@ -0,0 +1,24 @@ +#include "hbclass.ch" + +function main() + local oObject, oBase + oObject := TAnyClass():New() + oBase := TClassBase():New() +return nil + +class TClassBase + method New() + method Test() INLINE Alert( "Test" ) +endclass + +method New() class TClassBase +return Self + +class TAnyClass from TClassBase + method New() +endclass + +method New() class TAnyClass + super:New() + super:Test() +return Self \ No newline at end of file