From c62bd461e08fb4c2d2d775364e8edff2b04e5671 Mon Sep 17 00:00:00 2001 From: Kenneth Russel Date: Sat, 20 Dec 2008 09:44:54 +0000 Subject: Fixed more bugs in glue code generation related to using opaque long type for pointers returned in arrays: specifically, the return value of glXChooseFBConfig. However, this fix contains an inherent memory leak for certain C APIs because the original Buffer is not necessarily available to be manually freed. Still, fixes remaining problems with pbuffer support on X11 platforms. git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1825 232f8b59-042b-4e1e-8c03-345bb8c30851 --- src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/classes/com/sun') diff --git a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java index aa84b034a..db3dbc47f 100644 --- a/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java +++ b/src/classes/com/sun/opengl/impl/x11/glx/X11PbufferGLXDrawable.java @@ -119,6 +119,9 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable { true, display, screen); int[] nelementsTmp = new int[1]; + // FIXME: we inherently leak the memory from the underlying call + // to glXChooseFBConfig because a copy of the original Buffer is + // made to expand each pointer from 32 to 64 bits LongBuffer fbConfigs = GLX.glXChooseFBConfig(display, screen, iattributes, 0, nelementsTmp, 0); if (fbConfigs == null || fbConfigs.limit() == 0 || fbConfigs.get(0) == 0) { throw new GLException("pbuffer creation error: glXChooseFBConfig() failed"); -- cgit v1.2.3