Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object Creation and Releasing (or not)
Message
From
03/09/2008 07:54:42
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Object Creation and Releasing (or not)
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01344428
Message ID:
01344428
Views:
72
I have this in the Main program:
* JJ - Eligibility Project
_SCREEN.ADDPROPERTY("oXML")
_SCREEN.oXML = CREATEOBJECT("Microsoft.XMLHTTP")
Later, in other code I reference this object and use it's props, etc. with code like this:
	* Open POST
	_SCREEN.oXML.OPEN("POST", lcURL, .F.)

	* Set Headers
	_SCREEN.oXML.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
	_SCREEN.oXML.setRequestHeader("SOAPAction", "''")
	_SCREEN.oXML.setRequestHeader("authorization", cAuthenticate)

	TRY
		_SCREEN.oXML.SEND(submitRealtimeRequestXML)
		submitRealtimeRequestMessage = _SCREEN.oXML.ResponseText
At no point do I set it to NULL or recreate it. Should I be doing that? What is the best way to ensure that there are no memory leaks and that I'm using the object efficiently? I've noticed that over a period of time (hours maybe) that the object seems to go "dead" whereas I have to shut down and restart the app in order for the connection to work again. I'm not sure, but I think it's likely related to how I'm using this object. Or other similar ones.
Next
Reply
Map
View

Click here to load this message in the networking platform