INTRODUCTION AND RELEVANT INFORMATION:
The original project I work on has small memory leaks, so I have decided to perform a small test so I can detect what could cause them.
I have created a
Win32 project
using
Visual Studio wizard
.
I haven't added anything, I have just left it as it was created with the wizard. I have used the tool
GDIView
(
http://www.nirsoft.net/utils/gdi_handles.html[
^] ) to see if there are any inherent
GDI leaks
.
PROBLEM:
Each time I resize the window, this tool shows that there are +3 regions that my application leaks.
MY EFFORTS TO SOLVE THE PROBLEM:
Since the project was made by the Visual Studio wizard, I have tried to create a simple project from scratch, but the same +3 regions appear.
Reading through some articles on
CodeProject
about regions I have stumbled upon some demo applications that demonstrate the usage of them.
When I turn on
GDIView
these applications also leak +3 regions.
All of this is verified when I turn on
Task Manager
to see if the small memory leak is really occurring-it does occur since the memory
slightly rises and
stays constant afterwards no matter how many times I resize the window.
I use
Microsoft Visual Studio 2008 Express Edition
, but the problem was detected when empty project is created in
regular Visual Studio 2008
as well.
I work on
Windows XP
, but the same effect happens on
Windows 7
.
QUESTION:
Why is this happening and how to eliminate these small memory leaks?
Thank you.
Best regards.