I have a very special problem, concerning memory-accumulation (until collapse) while calling an OpenGL-controled dialog-window.
My program calculates the result of a packing problem and shows the result then (several packs) in 3D in a dialog window.
The result-graph in this dialog window is realized as a picture-control-area, that is controled by an OpenGL-class.
On the left and the right side of the picture-control, there are furthermore some other Non-OpenGL-controls, like editfields, buttons, etc.
The OpenGL-Class is embedded in the dialog-window-control-class as follows:
GetDlgItem(IDC_PICTUREGRAPH)->GetWindowRect(&rect); ScreenToClient(rect); m_oglWindow.oglCreate(rect, this); m_oglWindow.m_unpTimer = m_oglWindow.SetTimer(1, 1, 0);
Almost everything works fine.
The result-dialog-window (with the OpenGL-managed 3D-result-graph = picture-control-area) can be called from the main menu of the program, whenever the user want.
The problem is, that each time when the result-dialog-window is called again from the main menu, after it was called and closed already before, the required memory of the process of my program, how it is shown in the windows task-manager, increases, about 3 MB with each call and close (effect of memory-waste-accumulation). The whole memory-requirement of my software starts for example with 8 MB, after 10 calls of the result-window, it is at 33 MB. So if the user uses the program long enough, it will collapse.
The cause of that effect is definitely the OpenGL-part. If I enclose this part as a comment (for a test), so that the result-dialog-window shows a blank picture-control-area, but the other controls (Editfields, buttons, etc.) are still active, the memory-accumulation-problem does no longer exist.
So what’s the mistake ? What did I do wrong in my OpenGL-Code ? It is a total normal code, where I took the main part out of a published expert-example in the Web.
This is a tricky problem I guess, but my developed software can not be delivered to the customer, until this one is not solved. So please help me. All my own solve-attempts were not successful.