Releasing object references.... 
Author Message
 Releasing object references....

I have some session variables ("Scripting.Dictionary" vars) that I use to
store data during a user's session. In an ASP page, if I reference these
vars in a script, do I need to release them (the references) at the end of
the script?  Will the refs build up if I don't?

                Warfield

<%
        <<oMyVar = Session("UserData")>>

            .. some  work...

         <<set oMyVar=nothing>>
%>



Tue, 19 Sep 2000 03:00:00 GMT  
 Releasing object references....

I believe the reference should not "build up". However, I encountered a
problem a while back where if I did not release my connection object, I
eventually got an error (don't remember what it was, but it was an ODBC
error) When I changed the code to release the object every thing worked
fine.

Now the reason that I did not release the items in the first place is
because I forgot. It is good practice to release your object (garbage
collection) after you're done with them.

For tips on FP, HTML, ASP and more, visit: http://www.ojmnet.com
Microsoft VBScript and JScript are on-line (Script Docs section)

Best Regards,

Oscar J. Meszar
Your NT Resource Site: http://www.ojmnet.com
Start/Stop NT Services Remotely: http://www.ojmnet.com/startstop

Quote:

>I have some session variables ("Scripting.Dictionary" vars) that I use to
>store data during a user's session. In an ASP page, if I reference these
>vars in a script, do I need to release them (the references) at the end of
>the script?  Will the refs build up if I don't?

>                Warfield

><%
>        <<oMyVar = Session("UserData")>>

>            .. some  work...

>         <<set oMyVar=nothing>>
>%>



Sun, 24 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DirectX Events not releasing object reference

2. Killing client does not release object reference

3. Does the MS Script Control fail to release object references?

4. Releasing references to COM Automation objects

5. Releasing Reference to an Excel Object

6. VB won't release reference to COM object in use by another proces s

7. Passing an object reference by reference where the object has a default property

8. RELEASE OBJECTS --> RELEASE MEMORY

9. RELEASE OBJECTS --> RELEASE MEMORY

10. Release ActiveX Reference

11. Referencing object in form in code / Subform reference problem in code

12. reference to a non-shared member requires an object reference

 

 
Powered by phpBB® Forum Software