C
Carel Lotz
Hi
Our application dynamically assemblies screens at run-time
from definitions in a DB and we have been experiencing
memory leaks (more specific Handle leaks) to such a degree
that the application would eventually freeze on Win9x/ME
machines where the pool of resources is limited (unlike
Win2000/XP which will just keep on allocating resources).
The controls that we add to the form are all inherited
controls to provide a common interface to which to code
against. We eventually solved the leak by physically
calling dispose on each control when the form was closed.
We tested the same scenario with the same controls where
we beforehand added them to a static screen. When we
repeatedly displayed this form and closed the form no
memory leak occured. My question is, what is different
between having a form pre-polulated at design time with
controls and adding the same controls dynamically at run-
time? Why did we have to physically call Dispose in the
dynamic scenario and not in the static scenario?
Thanks
Carel
Our application dynamically assemblies screens at run-time
from definitions in a DB and we have been experiencing
memory leaks (more specific Handle leaks) to such a degree
that the application would eventually freeze on Win9x/ME
machines where the pool of resources is limited (unlike
Win2000/XP which will just keep on allocating resources).
The controls that we add to the form are all inherited
controls to provide a common interface to which to code
against. We eventually solved the leak by physically
calling dispose on each control when the form was closed.
We tested the same scenario with the same controls where
we beforehand added them to a static screen. When we
repeatedly displayed this form and closed the form no
memory leak occured. My question is, what is different
between having a form pre-polulated at design time with
controls and adding the same controls dynamically at run-
time? Why did we have to physically call Dispose in the
dynamic scenario and not in the static scenario?
Thanks
Carel