General information
Category:
Coding, syntax & commands
Title:
Releasing Object Reference?
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only