Skip to main content
GameDev.net gamedev.net
🔒 Locked

wglMakeCurrent memory leak?

Started by Digitalfragment Oct 16, 2005 at 10:32 PM 2 replies 3.1k views
Original Post
Digitalfragment
Digitalfragment
i was bug hunting the other day, and traced a memory leak down to where i was setting the active context between a PBuffer and the window's context. The actual line that causes the memory leak appears to be wglMakeCurrent(). I wrote a dummy application to test this and it caused the leak as well, as does the OpenGL demos in the ATI SDK. Is there anything i should be doing before/after wglMakeCurrent to stop this leak? Any help appreciated. - also, the memory is cleaned up when the program shuts down too, but i dont want to be leaking memory during the execution....
Yann L
Yann L
Oh yeah, the infamous ATI-Context-leak™

No, it's not your fault. No, there's nothing you can do about it, except complaining to ATI. No, it won't help. Yes, ATIs OpenGL driver developers suck.

Click...

You could switch to FBOs instead of PBuffers, so that you don't have to switch contexts anymore. Of course, this doesn't help if you need to render to different windows, or in different threads.

PS: just for statistics: how much memory does it leak on average on your setup, per call ?
Digitalfragment
Digitalfragment
thankgod its not my problem - i was stressing out about that for ages thinking i messed something up.

i still dont know anything about FBOs, i dont think my video card supports them (Radeon 9600XT). What is the actual extension for FBOs?

For statistics, when i was calling it 3 times per frame (reflection, refraction, scene) @ ~40fps, it looked around 12k a second. That said, i was using the task manager to determine that :(

Also, is there a way to query from the program how much memory its using?
V-man
V-man
Yes, Radeon 9500 and above have FBO, but you need to update your drivers as well.

Name is GL_EXT_framebuffer_object, you can find it at
http://oss.sgi.com/projects/ogl-sample/registry/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.