Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object is not released
Message
From
11/07/2003 12:11:42
 
 
To
10/07/2003 13:46:33
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00808842
Message ID:
00809239
Views:
27
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...
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform