Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
BUG: skip the Assign destroy object or fire a C5 crash
Message
 
 
À
09/04/2004 10:51:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00893546
Message ID:
00988439
Vues:
39
Hi Fabio,

The thread is quite long, so I could not follow the whole topic completely, but here is what we have found today:

in MereMortals framework the business object class is based on container. It instantiates several other objects in its life-time. When we do release loObject, its Destroy method is not fired. If we call it like loObject.release(), the Destroy method is fired. Do you think, this bug is related to what you've described?

>On VFP is not possible ignore a property assign for a object reference.
>If you define a property for a object reference, and a property_Assign procedure,
>then you must write the object reference into the property_Assign procedure
>
>Repro Click 3 times on command button:
>
>PUBLIC oform1
>
>oform1=NEWOBJECT("form1")
>oform1.Show
>RETURN
>
>DEFINE CLASS form1 AS form
>
>	myobject = .NULL.
>
>	ADD OBJECT command1 AS commandbutton WITH left = 150, Top = 50,AutoSize = .T.
>
>	PROCEDURE myobject_assign
>		LPARAMETERS myObject
>		IF m.THIS.myObject=m.myObject
>*			this.myObject = m.myObject && you must exec this assign
>			RETURN
>		ENDIF
>		* here exists code that i want skip if m.THIS.myObject=m.myObject
>		THIS.myObject = m.myObject
>	ENDPROC
>
>
>	PROCEDURE command1.Click
>		THISFORM.MYobject= m.This
>	ENDPROC
>
>ENDDEFINE
>
>
>Explain:
>
>* form builded
>* command1.RefCounter = 1
>
>* User Click 1
>THISFORM.MYobject= m.This
>* VFP compare m.THIS.myObject (NULL) with m.This,
>* they are not equal VFP, continue
>* call myobject_assign
>...
>THIS.myObject = m.myObject
>* command1.RefCounter = 2
>
>* User Click 2
>THISFORM.MYobject= m.This
>* VFP compare m.THIS.myObject (Command1) with m.This,
>* they are equal VFP, VFP sub 1 by command1.RefCounter  && this is the bug cause
>* command1.RefCounter = 1
>* call myobject_assign
>...
>
>* User Click 3
>THISFORM.MYobject= m.This
>* VFP compare m.THIS.myObject (Command1) with m.This,
>* they are equal VFP, VFP sub 1 by command1.RefCounter
>* command1.RefCounter = 0 ===> VFP release the CommandObject
>* call myobject_assign
>...
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform