Freeing memory phobia

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Martin Hart - Memory Soft, S.L. (memorysoft_at_infotelecom.es)
Date: 11/17/04


Date: Wed, 17 Nov 2004 17:46:21 +0100

I have a phobia about cleaning up after executing my code. Can someone in
the know help me :-)

-) If I add a delegate handler to a class, do I have to unplug it before
destroying the class for GC to work correctly?

-) Who actually calls Destroy if I implement IDisposable?

-) What is the difference between Destroy() and Destroy(bool) and who calls
each implementation and when?

-) Is it worth setting expired (variables I won't use again in a function)
variables to null to aid GC?

-) Can I or should I aid GC by using 'using' constructs or won't this help
if objects don't implement IDisposable?

Any help would be appreciated.

Regards,
Martin.



Relevant Pages

  • RE: pop up ads
    ... The following list of programs are what I use to aid in the removal of spyware\adware and pop-ups from BHO's. ... Spybot Search and Destroy ...
    (microsoft.public.windowsxp.newusers)
  • Re: Terminate worker thread when Dialog closes
    ... If the thread is executing a loop you can signal it by setting a bool that it tests. ... WaitForSingleObject will return after the thread has exited, then you can continue to destroy the dialog. ...
    (microsoft.public.vc.mfc)
  • Re: problem compiling on SGI/IRIX
    ... catch {destroy .b.c} ... canvas .b.c ... while executing ... ("uplevel" body line 5) ...
    (comp.lang.tcl)