Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Releasing Object Reference?
Message
 
 
To
All
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Title:
Releasing Object Reference?
Miscellaneous
Thread ID:
00495956
Message ID:
00495956
Views:
41
I want to know if you have to explicitly Set an object Reference to Nothing or will there be a memory leak? Please see example. I basically want to know if I should be setting the oDomDoc = Nothing?

Thanks.

Public Function GetDomDocByFile(strXmlSource As String, _
strLanguageCode As String, _
Optional blnLoadAsync As Boolean = False, _
Optional blnPreserveWhiteSpace As Boolean = False, _
Optional blnResolveExternals As Boolean = False, _
Optional blnValidateOnParse As Boolean = False) _
As MSXML.IXMLDOMNode

Dim oDomDoc As MSXML.DOMDocument

Set oDomDoc = New MSXML.DOMDocument

oDomDoc.async = blnLoadAsync
oDomDoc.preserveWhiteSpace = blnPreserveWhiteSpace
oDomDoc.resolveExternals = blnResolveExternals
oDomDoc.validateOnParse = blnValidateOnParse
oDomDoc.Load strXmlSource

'Convert resources to different language if needed.
modDasUIL.ConvertLanguage oDomDoc, strLanguageCode

Set GetDomDocByFile = oDomDoc.documentElement
Set oDomDoc = Nothing

End Function
Reply
Map
View

Click here to load this message in the networking platform