1. It seems that using wglDeleteContext does not free all the memory
allocated by wglCreateContext. For example in the following code,
part of the memory allocated in wglCreateContext leaks :
HDC hDC = ::GetDC(hWnd);
HGLRC hGLContext = wglCreateContext(hDC);
wglMakeCurrent(hDC,hGLContext);
...
wglMakeCurrent(NULL,NULL);
wglDeleteContext(hGLContext);
::ReleaseDC(hWnd,hDC);
Could someone tell me how to release all the memory ?
2. I'm writing an application with multiple gl windows (using
Visual C++ 6.0). Is there a way of implementing application
like this without keeping multiple rendering contexts in memory ?
Thanks
Yael
-Nick
Yael Weinbach <ya...@biomedicom.co.il> wrote in message
news:377642AD...@biomedicom.co.il...
Nick wrote in message ...
Try creating and deleting several contexts in a loop. If you see a
substantial memory leak from doing this, it is probably a bug which should
be reported to your vendor.
> HDC hDC = ::GetDC(hWnd);
> HGLRC hGLContext = wglCreateContext(hDC);
> wglMakeCurrent(hDC,hGLContext);
> ...
> wglMakeCurrent(NULL,NULL);
> wglDeleteContext(hGLContext);
> ::ReleaseDC(hWnd,hDC);
Losing some memory after a single create-delete pair may not be a butg,
depending on how your implementation works.
> Could someone tell me how to release all the memory ?
>
>2. I'm writing an application with multiple gl windows (using
> Visual C++ 6.0). Is there a way of implementing application
> like this without keeping multiple rendering contexts in memory ?
Just use one context instead of multiple contexts. All your windows will
need to use the same pixel depth, attributes (such as Z buffer), etc.
-Paul Martz
Hewlett Packard Workstation Systems Lab
To reply, remove "DONTSPAM" from email address.
Paul Martz wrote in message <7l8crn$s44$1...@fcnews.fc.hp.com>...