Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form property memory leak issue
Message
De
23/05/2003 09:20:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00790518
Message ID:
00792176
Vues:
28
Here is a code repro. This is fixed in VFP8. You lose 1 handle and 4 bytes (as seen by SYS(1011) and SYS(1016) respectively) each time a textbox value is changed, if it is bound to a member property.
LOCAL aobj[1], xx
DELETE FILE testxx.sc?
CREATE FORM testxx NOWAIT
=ASELOBJ(aobj,1)
xx = aobj[1]
xx.autocenter = .t.
xx.addproperty("cproperty")
xx.cproperty = ""
xx.addobject('txt1','textbox')

* comment out this line and uncomment next for workaround
xx.txt1.controlsource= "thisform.cproperty"
* xx.txt1.writemethod('valid','thisform.cproperty = this.value')
KEYBOARD 'Y' CLEAR
RELEASE WINDOW 'Form Designer'
CLEAR 
FOR lnj = 1 TO 5
	DO FORM testxx.scx 
	FOR lni = 1 TO 10
		testxx.txt1.value = "abc"
	ENDFOR 
	testxx.release()
	_CALCMEM = lnj
	CLEAR ALL
	=SYS(1104)
	SET MESSAGE TO
	LOCAL lnj
	lnj = _CALCMEM
	?SYS(1016),SYS(1011),lnj
ENDFOR
RETURN
>>I seem to remember there is a memory leak when using custom properties on a form that are a character type in VFP 7. Can anyone tell me how to test for this? Would there still be a memory leak if other controls/classes use custom character properties? If not, I could move my form properties to an object that can be referenced from the form (i.e. ThisForm.oProps.customer_name).
>>
>>Thanks in advance for any advice.
>
>Hi Don,
>
>I don't remember VFP7 having such problem. If you're concern with that you can skip VFP7 and move directly to VFP8.
Jim Saunders
Microsoft
This posting is provided “AS IS”, with no warranties, and confers no rights.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform