Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Object is not released
Message
De
11/07/2003 12:11:42
 
 
À
10/07/2003 13:46:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00808842
Message ID:
00809239
Vues:
28
Hi,
The following is my class.
DEFINE CLASS cObject AS SESSION
  PROCEDURE RELEASE
    IF THIS.lRelease
	NODEFAULT
	RETURN .F.
    ENDIF
		
    THIS.CleanUp()
    RELEASE THIS
  ENDPROC

  PROCEDURE CleanUp
    WITH THIS
      IF .lRelease
	RETURN .F.
      ENDIF
		
      .ReleaseMember()
    ENDWITH
  ENDPROC

  PROCEDURE ReleaseMember
  ENDPROC
ENDDEFINE

DEFINE CLASS cBizObj AS cObject
  oValidator = .NULL.

  PROCEDURE INIT
<B>    THIS.oValidator = CREATEOBJECT("cValidatorObj", THIS)</B>   && Object will stay in memory if THIS passed to cValidator
  ENDPROC

  PROCEDURE ReleaseMember
    THIS.oValidator.RELEASE()
    DODEFAULT()
  ENDPROC
ENDDEFINE

DEFINE CLASS cValidatorObj AS cObject
  oBusiness = .NULL.

  PROCEDURE INIT
  LPARAMETER toObj
    THIS.oBusiness = toObj
  ENDPROC

  PROCEDURE ReleaseMember
    THIS.oBusiness.RELEASE
    DODEFAULT()
  ENDPROC
ENDDEFINE


*---Main.prg
loObj = CREATEOJECT("cBizObj")
loObj.RELEASE
Is it the right way?

Pls advise.
I am not the most powerful man in this world.
I am not the worst man in this world either.
I just as same as all of you.
I still need to learn from my mistakes...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform