From 5906d6cd747092f1e73b32f3337563fa74cec2d2 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 28 Nov 2013 22:43:25 +0100 Subject: GLDrawableFactory: destroy() -> shutdownImpl() - Add DEBUG output in implementation --- src/jogl/classes/javax/media/opengl/GLDrawableFactory.java | 4 ++-- src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 8 +++++--- .../jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java | 5 ++++- .../jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java | 5 ++++- src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java | 5 ++++- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java index 2b1d228ad..fcc1494ce 100644 --- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java +++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java @@ -220,7 +220,7 @@ public abstract class GLDrawableFactory { } try { gldf.resetDisplayGamma(); - gldf.destroy(); + gldf.shutdownImpl(); } catch (Throwable t) { System.err.println("GLDrawableFactory.shutdownImpl: Catched "+t.getClass().getName()+" during factory shutdown #"+(i+1)+"/"+gldfCount+" "+gldf.getClass().getName()); if( DEBUG ) { @@ -251,7 +251,7 @@ public abstract class GLDrawableFactory { protected void enterThreadCriticalZone() {}; protected void leaveThreadCriticalZone() {}; - protected abstract void destroy(); + protected abstract void shutdownImpl(); public abstract void resetDisplayGamma(); diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java index 1438107fe..f7799f1ec 100644 --- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java @@ -207,17 +207,19 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl { @Override - protected final void destroy() { + protected final void shutdownImpl() { + if( DEBUG ) { + System.err.println("EGLDrawableFactory.shutdown"); + } if(null != sharedMap) { if(DEBUG) { - System.err.println("EGLDrawableFactory.destroy() .. "); dumpMap(); } Collection srl = sharedMap.values(); for(Iterator sri = srl.iterator(); sri.hasNext(); ) { SharedResource sr = sri.next(); if(DEBUG) { - System.err.println("EGLDrawableFactory.destroy(): "+sr.device.toString()); + System.err.println("EGLDrawableFactory.shutdown: "+sr.device.toString()); } sr.device.close(); } diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java index e41c97827..9ce71cfe9 100644 --- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java @@ -126,7 +126,10 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl { } @Override - protected final void destroy() { + protected final void shutdownImpl() { + if( DEBUG ) { + System.err.println("MacOSXCGLDrawableFactory.shutdown"); + } if(null != sharedMap) { sharedMap.clear(); sharedMap = null; diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index 64ed197ea..7fa8775cf 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -140,7 +140,10 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { @Override - protected final void destroy() { + protected final void shutdownImpl() { + if( DEBUG ) { + System.err.println("WindowsWGLDrawableFactory.shutdown"); + } if(null != sharedResourceRunner) { sharedResourceRunner.stop(); sharedResourceRunner = null; diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 78e549508..f7938f463 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -137,7 +137,10 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { } @Override - protected final void destroy() { + protected final void shutdownImpl() { + if( DEBUG ) { + System.err.println("X11GLXDrawableFactory.shutdown"); + } if(null != sharedResourceRunner) { sharedResourceRunner.stop(); sharedResourceRunner = null; -- cgit v1.2.3