Results 1 to 3 of 3

Thread: New Garbage Collection??

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    12

    New Garbage Collection??

    When I upgraded my VB6 code to VB.NET I got this error.

    'UPGRADE_NOTE: Object FSO may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1029"'
    FSO = Nothing
    'UPGRADE_NOTE: Object FileName may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1029"'
    FileName = Nothing
    'UPGRADE_NOTE: Object TS may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1029"'
    TS = Nothing

    How do I make sure that i am destroying these objects or what is the correct way to do this in VB.NET. Thanks in advance.

  2. #2
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    FSO = FileSystemObject?


    If it is, its probably

    VB Code:
    1. FSO.Destroy()


    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2004
    Posts
    12

    Thanks

    Here is how I declared the variables.

    Public FSO As Scripting.FileSystemObject
    Public FileName As Scripting.File
    Public TS As Scripting.TextStream


    So I can reclaim the memory by putting

    FSO.Destroy()
    FileName.Destroy()
    TS.Destroy()

    ???

    Thanks.

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