Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Releasing Object Reference?
Message
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Titre:
Releasing Object Reference?
Divers
Thread ID:
00495956
Message ID:
00495956
Vues:
42
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
Répondre
Fil
Voir

Click here to load this message in the networking platform