Memory (malloc) error during redraw

After drawing, i try to adjust the size of the window rapidly until memory (malloc) error comes out. Where go wrong?
There is no drawing instruction in OnSize(). As for OnDraw(), there are wglMakeCurrent( m_hDC, m_hRC), glClear(GL_COLOR_BUFFER_BIT), glLoadIdentity(), glPushMatrix(), glTranslatef(), display some lists, glPopMatrix(), glFinish() and finally SwapBuffers(m_hDC).

Please help.

Thanks in advance.

use a debugger to see what actually generate the error.

malloc ? maybe you forget to free() something ?

i got the error from the debugger saying malloc error. Other than the Onsize() and OnDraw() functions being called, there is no other as far as i know. Within the OnDraw function is a call to another display routine somewhere else. Except opengl instructions and local variable declaration, there is no memory request/calling function (malloc, calloc). Will it be due to hardware or opengl instruction that request memory and is being call repeatly.

Thanks.

it is a pretty unuseful debugger if it does not give the stack trace and exact place where the problem occur…

Can you give more details about your machine’s specs ? video card, os, ram, driver version, GL version, compiler, debugger, …

Built-in graphics SIS video driver, VC++ 6.0, 256 DDRAM, Win XP. In fact, it only give out error message (in the message box from the debugger) but the program is still able to run until memory runs out/low then it stop.
Just don’t know where should i release the memory.

Thanks.

It might be the driver, try to upgrade your graphic driver at SIS website.

Anyway it will be hard to help you if don’t give more details …

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.