summaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/gluegen')
-rw-r--r--src/java/com/jogamp/gluegen/JavaEmitter.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/java/com/jogamp/gluegen/JavaEmitter.java b/src/java/com/jogamp/gluegen/JavaEmitter.java
index 02e56a4..577bca4 100644
--- a/src/java/com/jogamp/gluegen/JavaEmitter.java
+++ b/src/java/com/jogamp/gluegen/JavaEmitter.java
@@ -2554,6 +2554,7 @@ public class JavaEmitter implements GlueEmitter {
"#define JINT_MAX_VALUE ((size_t)0x7fffffffU)\n"+
"static const char * sNewBufferImplNotCalled = \"initializeImpl() not called\";\n"+
"static const char * sNewBufferMAX_INT = \"capacity > MAX_INT\";\n"+
+ "static const char * sNewBufferEXCPT = \"New direct ByteBuffer threw Exception\";\n"+
"static const char * sNewBufferNULL = \"New direct ByteBuffer is NULL\";\n"+
"\n"+
"static jobject JVMUtil_NewDirectByteBufferCopy(JNIEnv *env, void * source_address, size_t capacity) {\n"+
@@ -2571,6 +2572,12 @@ public class JavaEmitter implements GlueEmitter {
" return NULL;\n"+
" }\n"+
" jbyteBuffer = (*env)->CallStaticObjectMethod(env, clazzBuffers, cstrBuffersNew, (jint)capacity);\n"+
+ " if( (*env)->ExceptionCheck(env) ) {\n"+
+ " (*env)->ExceptionDescribe(env);\n"+
+ " (*env)->ExceptionClear(env);\n"+
+ " (*env)->FatalError(env, sNewBufferEXCPT);\n"+
+ " return NULL;\n"+
+ " }\n"+
" if( NULL == jbyteBuffer ) {\n"+
" fprintf(stderr, \"%s %s: size %lu\\n\", sFatalError, sNewBufferNULL, (unsigned long)capacity);\n"+
" (*env)->FatalError(env, sNewBufferNULL);\n"+