|
-
Aug 28th, 2002, 03:45 PM
#1
Shared members and Finalize
If I have a class that has a Shared SQLConnector in it where do I put my clean up code? Or do I not put it?
I mean is there a way to tell if there are no more instances of the class left and then perform the clean up in an Overrides Finalize method? Or is it safe to assume the garbage collection will handle this good enough?
The connection isn't left open so the main clean up is just to make sure its set back to nothing or maybe a backup check to make sure it IS closed and if not to close it (although like I said it shouldn't be open anyway).
Or do you think I should just share a string instead and use it as the connection string instead of the whole connection object?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|