i need some advices abou found errors\bugs and leaks

i'm testing my program, on GDIViewer i don't find anything. on Task Manager i see the GDI column count growing. on my opinion it's some GDI object that isn't destroyed.
i know more or less where is the problem, but the GDI objects are destroyed. so i'm confused :(
what can anyone advice me?
Maybe you should check the return value from DeleteObject if it is really deleted.
https://msdn.microsoft.com/en-us/library/windows/desktop/dd183539(v=vs.85).aspx
i was forgeting these member:
1
2
3
4
5
6
7
void Brush(COLORREF BrushColor)
    {
        if(DeleteBrush(imgBrush)==FALSE)
            DebugText("brush color not deleted");
        imgBrush=CreateSolidBrush(BrushColor);
        //DeleteBrush(BrushColor);
    }

normaly these happens, because the imgBrush stills selected to HDC, right?
the brush isn't deleted. why?
(in these situation wasn't selected to any HDC)
i was creating on another place without notice.
i can't create a solid brush directly on a function parameter, because it must be destroyed.
thanks for all
Topic archived. No new replies allowed.