RELEASE MemVarList


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: RELEASE MemVarList

  1. #1
    jimi Guest

    RELEASE MemVarList


    hi,

    I have defined some public variables in the init event of a form. When the
    form is released, will those variables be released too? Or I still need to
    release them myself in the destroy event? (in case i need to make sure they
    are not in the memory anymore)

    -jimi

  2. #2
    Fred - Armoni Guest

    Re: RELEASE MemVarList

    jimi a écrit :
    >
    > hi,
    >
    > I have defined some public variables in the init event of a form. When the
    > form is released, will those variables be released too? Or I still need to
    > release them myself in the destroy event? (in case i need to make sure they
    > are not in the memory anymore)
    >
    > -jimi


    If your variables are scoped by the form only, why don't you use private? they
    will be released with the form (or better forms properties).

    For your question : yes, you need to release them because of their public
    status.

    Fred
    --
    FE AVP&Cie
    Juillenay, Europe

  3. #3
    Dan Freeman Guest

    Re: RELEASE MemVarList

    Fred, you know better than this but just to make sure lurkers aren't
    misled....

    Making a memvar private would scope it to the method that creates it, NOT
    the form.

    Dan


    "Fred - Armoni" <armoni@club-internet.fr> wrote in message
    news:3AB0969A.47FA47DD@club-internet.fr...
    >
    > If your variables are scoped by the form only, why don't you use private?

    they
    > will be released with the form (or better forms properties).





  4. #4
    Dan Freeman Guest

    Re: RELEASE MemVarList

    As Fred said, public memvars probably aren't the best way to handle values
    that are scoped to a form.

    Consider creating custom properties of the form to store the values. Once
    you've created them in the form designer (Form menu), you don't need to
    worry about declaring them in code and you don't have to worry about
    releasing them, and they're visible from any of the form's methods.

    Dan

    "jimi" <jimi@hkem.com> wrote in message news:3ab08c25$1@news.devx.com...
    >
    > hi,
    >
    > I have defined some public variables in the init event of a form. When the
    > form is released, will those variables be released too? Or I still need to
    > release them myself in the destroy event? (in case i need to make sure

    they
    > are not in the memory anymore)
    >
    > -jimi




  5. #5
    Fred - Armoni Guest

    Re: RELEASE MemVarList

    Dan Freeman a écrit :
    >
    > Fred, you know better than this but just to make sure lurkers aren't
    > misled....
    >
    > Making a memvar private would scope it to the method that creates it, NOT
    > the form.
    >
    > Dan
    >
    > "Fred - Armoni" <armoni@club-internet.fr> wrote in message
    > news:3AB0969A.47FA47DD@club-internet.fr...
    > >
    > > If your variables are scoped by the form only, why don't you use private?

    > they
    > > will be released with the form (or better forms properties).


    oops again, i was thiking "application object", someday i should better go back
    to bed.

    Fred
    --
    FE AVP&Cie
    Juillenay, Europe

  6. #6
    Toms Ng Guest

    Re: RELEASE MemVarList


    In my opinion , if the variables you want to use in the whole application
    use PUBLIC , else , if just use in any parts of one form , use NEW PROPERTY.
    You dont need to worry in NEW PROPERTY , since it will release when the form's
    destory event.
    But , if you use PUBLIC , you need to release by code.(RELEASE gcPublic ,
    gcPublic2 extended)

    Hope can help you

    Toms

    "jimi" <jimi@hkem.com> wrote:
    >
    >hi,
    >
    >I have defined some public variables in the init event of a form. When the
    >form is released, will those variables be released too? Or I still need

    to
    >release them myself in the destroy event? (in case i need to make sure they
    >are not in the memory anymore)
    >
    >-jimi



  7. #7
    mihai Guest

    Re: RELEASE MemVarList


    "jimi" <jimi@hkem.com> wrote:
    >
    >hi,
    >
    >I have defined some public variables in the init event of a form. When the
    >form is released, will those variables be released too? Or I still need

    to
    >release them myself in the destroy event? (in case i need to make sure they
    >are not in the memory anymore)
    >
    >-jimi

    Release public variables in the destroy event

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center