home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,524 of 10,840   
   Dikkie Dik to Tony Van   
   Re: What's memory leak?   
   24 May 05 19:39:25   
   
   From: nospam@nospam.org   
      
   Tony Van wrote:   
   > I think I know what it is-- objects not being set to nothing   
   > when the program is finished with them   
      
   That's one. If you have circular references (two objects pointing to   
   each other, but your program doesn't point to either of them anymore),   
   the objects are not automatically cleared. This can result in a   
   "hanging" application, because VB is apparently waiting for either of   
   them to be set to nothing.   
      
   If you are working with API calls, a memory leak can also be a memory   
   structure generated by the API call that is not properly "handed back"   
   to the operating system.   
      
   >   
   > How can I tell if I have it?   
      
   Especially the last one: you probably can't.   
   >   
   > How can I code to avoid it?   
      
   Avoid circular references, or implement some sort of Dispose method. Be   
   aware that if a form has an object variable that contains an object   
   pointing to controls on that form, VB regards it as a circular reference.   
   You can also use close/unload/terminate events to trigger disposal code.   
      
   Best regards   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca