Win32 API Memory Leak

I have an application with four main tabs. I am encountering a 4k memory leak on about every sixth to eighth tab change. Not much, I know, but it's bugging me. The ONLY place I can figure the leak is in the following code, although I can't for the life of me see how the following code could be causing the leak. Is this code leaking memory...

1
2
3
4
5
6
7
if(NULL != hAccel)
	{
		DestroyAcceleratorTable(hAccel);
		hAccel=NULL;
	}

	hAccel = LoadAccelerators(hBOSSInst, MAKEINTRESOURCE(IDR_VLO_ACCEL));


Or are there some memory gremlins lurking about that I can't see?
closed account (z05DSL3A)
You should check the return from DestroyAcceleratorTable() before nulling hAccel.
It will return nonzero if it succeeds and zero on failure. It will fail if CreateAcceleratorTable or LoadAccelerators function are called more than once.
Good idea. I'll do that.
Topic archived. No new replies allowed.