From: Lloyd D. <ll...@ga...> - 2001-11-15 09:05:11
|
> ctxt = (HG3D) malloc(sizeof(HG3D)); > if(!ctxt) > return NULL; > ----- > > I am not sure but shouldn't it be "sizeof(G3D)" and not "sizeof(HG3D)"? > Otherwise wouldn't there be a memory overrun? > > oopps ! what a beginner's mistake ! you totally right ! i will correct it tonight, and would update the site as well... . . . > ------ > DLLOBJ int DMrelease3DCtxt(HG3D ctxt) > { > .... > } > ------ > > I did some checks and unless you dispose of OpenGLContext from the > thread on which you created it, instead of letting the GC delete it > later, both the wglDeleteContext() and ReleaseDC() will fail. Currently > "csopengl.c" doesn't check if they fail so you would never know if you > are writing bad code. hu.... this is a tedious issue i was not aware of... GC should have its own separate thread so this is not the solution. (does it work for you ?) i will think of it... |