Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to delete static variable

how to delete static variable

Scheduled Pinned Locked Moved C#
tutorialannouncement
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kalyan_2416
    wrote on last edited by
    #1

    i want to knwo a way how to release a static variable ....

    C Q 2 Replies Last reply
    0
    • K kalyan_2416

      i want to knwo a way how to release a static variable ....

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      kalyan_2416 wrote:

      i want to knwo a way how to release a static variable ....

      I'm not exactly sure what you mean by "release". Do you mean you no longer want the object it references? If so, then just assing null to it.


      Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

      K 1 Reply Last reply
      0
      • K kalyan_2416

        i want to knwo a way how to release a static variable ....

        Q Offline
        Q Offline
        quiteSmart
        wrote on last edited by
        #3

        do u mean to realease the variable when closing the program. if so there is no need cz they will be released automatically.

        1 Reply Last reply
        0
        • C Colin Angus Mackay

          kalyan_2416 wrote:

          i want to knwo a way how to release a static variable ....

          I'm not exactly sure what you mean by "release". Do you mean you no longer want the object it references? If so, then just assing null to it.


          Upcoming events: * Glasgow Geek Dinner (5th March) * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos

          K Offline
          K Offline
          kalyan_2416
          wrote on last edited by
          #4

          hi angus my requirement is like this there is a static variable which i assign a value to it at the start of the application. basing on that i will divert to other pages..... while i close my application i need to make the static variable to die or assign some thing to else to it so that no longer the old value exits bye

          C 1 Reply Last reply
          0
          • K kalyan_2416

            hi angus my requirement is like this there is a static variable which i assign a value to it at the start of the application. basing on that i will divert to other pages..... while i close my application i need to make the static variable to die or assign some thing to else to it so that no longer the old value exits bye

            C Offline
            C Offline
            Christian Graus
            wrote on last edited by
            #5

            What type is it that it needs to be released ? If it;'s a string, it's not going to exist anymore, the app that holds it will have closed. If it's got an external handle or something, you can call Dispose on it in your main forms Close event handler.

            Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups