[java-gnome-hackers] Check return vales
Brought to you by:
afcowie
|
From: Andrew C. <an...@op...> - 2011-10-24 06:34:16
|
When you're working in C, please check the return value of every JNI
function,
+ _array = (*env)->NewObjectArray(env, size, stringCls, NULL);
+
+ if ((*env)->ExceptionCheck(env)) {
+ (*env)->ExceptionDescribe(env);
+ g_printerr("Unable to create array?");
+ }
and meanwhile, if there's an exception pending, just return from the
function; Java will do the right thing once control returns to the JVM.
AfC
Sydney
|