|
-
Feb 9th, 2012, 12:29 PM
#1
Thread Starter
Hyperactive Member
GarbageCollector & Unloading Procedures
So if anyone has fallowed any of my post, then you will know I'm still in the process of transferring to pure vb.Net, while simultaneously trying to rid any bad habits that stemmed from the good 'ol vb6 days.
So having said I have a few question that are in regards to the GarbageCollector. Now I'm not looking to modify or mess with it at all, but rather it's exact functionality and where I should be disposing of and handling my own unloading.
For the sake of my coding style I like to run my application differently than most(unless this is the way it should be done) but this only applies to my more large project...
So this is how it all begins...
vbnet Code:
Sub Main() Call Loader() 'Here I handle specifics with my main screen form, such as preparing it and setting it up just like you would see in an initialization procedure. Also my scheduler control. Stuff that didn't quite fit under my Loader procedure above. 'Run the application. System.Windows.Forms.Application.EnableVisualStyles() System.Windows.Forms.Application.Run(MainScreen) Call Unloader() End Sub
So as you can already guess my startup object is the AppMain sub, and I have the application framework disabled.
Now my question lies within the Unloader.
I'm not sure how the GarbageCollecter functions, so truly I'm not sure if my code there is necessary or unnecessary. What it does is unloads all open forms that may have been left behind, plus it closes the database connection if one is open. Also I'm wondering if its a good idea to clear all my collection as well. My concern with the collections is just I have sooo much information being stored(it's a business management system that handles transactions, appointments, inventory clients employees etc etc) and this keeps growing. So I'm not really sure if all this gets handled automatically by the GarbageCollector or if it's good practice to begin clearing out this data and disposing it before hand.
Thanks in advanced!
Last edited by DavesChillaxin; Feb 9th, 2012 at 01:04 PM.
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
|