From: Kenneth B. R. <kbr...@al...> - 2002-03-30 15:49:03
|
Thanks, this looks like a good fix. I tested it and it clears up the warning that Arkanae was printing upon exit as well. It's been checked in to the source tree on SourceForge. > After doing some debugging I made the following change to my source. > > In file : OpenGL_Win32_jawt.c > In the method : gljDestroyNative > > We were trying to delete a context with : disp__wglDeleteContext(gc). An > error was occurring on my system (WinNT), I think, because the context > being deleted (gc) belonged to a thread other than the current thread and > thus threw an EXCEPTION_ACCESS_VIOLATION. > Previous to this (a few lines up from the above) we were calling : > disp__wglMakeCurrent( NULL, NULL ) , which detaches the rendering context > from the current thread and makes it non-current, in preparation for > deletion. This call, however, was failing on my system. I am assuming it > was failing, again, because the current thread did not hold the rendering > context. > > I am not exactly sure why the thread did not own the context. I must admit, > my experience with GL Windows programming is very limited. But here is what > I did to fix my error : > > I changed disp__wglMakeCurrent( NULL, NULL ) to disp__wglMakeCurrent( > thisWin, gc ) so that the current thread now owns the context. Then, when > it gets around to deleting it a few lines later, no error occurs. According > to MSDN the disp__wglDeleteContext(gc) call will actually change the > rendering context to being non-current before deleting so really the > original disp__wglMakeCurrent( NULL, NULL ) was redundant. The only > important thing is to make sure that the current thread owns the context > before deleting it. > > Is it a hack? I don't know. Thoughts? It has stopped my error though. |