Results 1 to 5 of 5

Thread: Easy one

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234

    Easy one

    If I write:

    dim tmpObj as Object
    .... do something with tmpObj
    ' and than
    tmpObj=Nothing

    Did last line of code release resources used by tmpObj?

    regard j

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Basically, the gc will look for unattached roots (orphaned references) on the heap. As long as there is no other references to the object (in this example, there isn't), the garbage collector will deallocate its memory on the next cycle.

  3. #3
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681
    It only marks it for the GC as ready to be collected. When the GC runs, it will release resources.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Location
    top of the mountain
    Posts
    234
    tks all

  5. #5
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    aaah this would end in endless discussion.Better you check previous threads for further info.

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