Results 1 to 2 of 2

Thread: Cleanup guidelines?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2002
    Posts
    1,602

    Cleanup guidelines?

    When I programmed C++ I used class destructors very carefully and in those days it was just as important to cleanup after yourself than it was to write the program correctly.

    But in .net no one seem to focus on cleanup code. I understand the concept of garbage collection, but I still find it a bit intimidating never have towrite any cleanup code...
    What if I write a winforms app with lots of class declarations, arraylists, custom objects... an app that is thriving with the keyword "new"... and then I just close down the form. Will all the memory allocated then return to the OS? Are there any guidelines when to remove object references with the "nothing" keyword?
    And is it good or bad .net coding to use the GC manually? Like running

    GC.Collect() upon Form1_Closing event?

    Most apps have a end button or something... what cleanup code (except obvious things like closing db pipes etc) should I but there in my .net apps? No books seem to really touch the subject.

    kind regards
    Henrik

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    This is probably the perfect article for you.

    http://www.vbdotnetheaven.com/Code/Jun2003/2045.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width