0

I have a function which displays some text on screen

void DisplayText()
{
    RECT rct;
    rct.left = 250;
    rct.right = 500;
    rct.top = 150;
    rct.bottom = 400;
    titleFont->DrawText(NULL,L"Hello world" , -1, &rct, DT_CENTER, D3DCOLOR_ARGB(255, 255, 255, 255));
}

titleFont is of LPD3DXFONT.

If I run application with above code, its memory usage keeps on increasing (I think it is memory leak)

However,If I comment just one line from code which contains call to DrawText, keeping remaining code as it is. Its memory usage remains constant. (no memory leak)

What could be causing this problem?

Thanks in advance.

Talha5389
  • 738
  • 1
  • 9
  • 22
  • Can you run a profiler tool to confirm the memory leak? It's possible there's a leak here, but I'd be very surprised if that really was the case. – templatetypedef Nov 01 '14 at 18:04
  • Please explain, how do I run a profiler tool and test it? I am using Visual Studio. – Talha5389 Nov 01 '14 at 18:06
  • I'm actually not familiar with how to do this in Windows (I typically develop in Linux), but this older question might have some advice: http://stackoverflow.com/questions/413477/is-there-a-good-valgrind-substitute-for-windows – templatetypedef Nov 01 '14 at 18:33
  • @Talha5389, try Deleaker, but don't forget to disable filters. Make a snapshot before calling DrawText and the second snapshot after the call. Then just compare them. – Artem Razin Nov 02 '14 at 11:50

0 Answers0