CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2001
    Posts
    5

    VB Form Unload problem

    Does unloading a form in VB using the Unload statement cause a Memory leak? I had read this
    somewhere. Please let me know.

    Thanks



  2. #2
    Join Date
    Dec 1999
    Posts
    128

    Re: VB Form Unload problem

    I've never heard that. From what i know, the END statement is the one that causes memory leaks. Unloading a form is the normal way to do things.

    Nick A.
    -------------------------
    Nick A.

  3. #3
    Join Date
    Mar 2000
    Location
    Arizona, USA
    Posts
    493

    Re: VB Form Unload problem

    Make sure you set the form to nothing after unloading it.

    private Sub Form_Unload (Cancel as Integer)

    '//Unload The Form
    Unload Form1

    '//set Form to nothing to Prevent Memory Leaks
    set Form1 = nothing

    End Sub





    Kris
    Software Engineer
    Phoenix,AZ
    Kris
    Software Engineer
    Phoenix, AZ USA

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

Featured