|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Do you need to close a Server.CreateObject ?
I am doing a bit of ASP and I have created a new object, for example:
set sourceDOM=Server.CreateObject("Microsoft.XMLDOM") When I am done with the code do I need to worry about killing or closing this object? If so, how? Thanks, Cul |
|
#2
|
||||
|
||||
|
You always want to close & kill your objects/connections.
Code:
sourceDOM.close set sourceDOM=nothing |
|
#3
|
|||
|
|||
|
Just out of a point of interest, what would happen if you didnt?
Anything major? |
|
#4
|
|||
|
|||
|
Quote:
The object should be destroyed by asp automatically, but if for some reason that doesn't happen, you end up with an "orphaned" object in memory (aka "memory leak"). Close and destroy what you create and open is good programming style.
__________________
====== Doug G ====== "Hide, hide witch! The good folk come to burn thee. Their keen enjoyment hid behind their gothic mask of duty." -Mark Clifton |
|
#5
|
|||
|
|||
|
Great, thanks!!
Cul |
|
#6
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Do you need to close a Server.CreateObject ? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|