• Welcome to Valhalla Legends Archive.
 

Memory Leaks

Started by Lenny, April 20, 2004, 08:23 PM

Previous topic - Next topic

Adron

#15
Quote from: Grok on April 21, 2004, 12:31 PM
You have to get pretty sloppy to do that?

If you build yourself a huge tree of objects that reference each others in intricate ways, I can see a loop happening easily. Circular references happen naturally when you get lots of objects notifying each other about things.

Edit:

Other example: Create a binary tree where each node is an object and has pointers to its child nodes and parent node so you can walk the tree any way you like. Eibro has a C++ one of those as in his assignment for Skywing.

If you make such a structure in VB and don't walk through the tree removing the nodes when you want to get rid of the structure, you've made yourself a memory leak.