How to disable destroy() by AWT thread?

Hullo ;D

I’m working on a JOGL applet, and in my code (that handles the applet content), I have a specific thread that holds the contexts including the openGL context (with periodic release).
Problem arises during the closing of the applet, because AWT thread will try to destroy the gl context while actually the destroying is already handled by my own thread. And exception occurs in the GLContextImpl.destroy() and GLContextLock.lock()…

So I’m wondering is there any work around on this problem, to let my own thread do the final release and destroy (and, in the jogl level, disable the destroying of the context by other thread)?

Any help is greatly appreciated :slight_smile:
thanks in advance.

I think you either need to subclass GLCanvas or write your own heavyweight OpenGL widget to have different behavior in removeNotify(). Or are you already doing this?

The problem is solved! Thanks! Yea, we end up doing some modification in the removeNotify() :smiley: