[java-atk-wrapper] JNI: return JNI_ERR if JNI is NULL
- From: Magdalen Berns <mberns src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] JNI: return JNI_ERR if JNI is NULL
- Date: Mon, 16 Mar 2015 23:06:58 +0000 (UTC)
commit ebcf2ffcb815ac5ccb28db13b225446c1c2fdc99
Author: Magdalen Berns <m berns thismagpie com>
Date: Mon Mar 16 23:06:03 2015 +0000
JNI: return JNI_ERR if JNI is NULL
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=746316
jni/src/jawutil.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/jni/src/jawutil.c b/jni/src/jawutil.c
index 700e00e..a38ab76 100644
--- a/jni/src/jawutil.c
+++ b/jni/src/jawutil.c
@@ -28,6 +28,10 @@
#include "jawtoplevel.h"
#include "jawobject.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* AtkUtil */
static void jaw_util_class_init(JawUtilClass *klass);
@@ -311,7 +315,7 @@ guint
jaw_util_get_tflag_from_jobj(JNIEnv *jniEnv, jobject jObj)
{
guint tflag = 0;
- jmethodID jmid;
+ jmethodID jmid;
jclass classAccessibleContext = (*jniEnv)->FindClass(jniEnv,
"javax/accessibility/AccessibleContext");
jclass classAccessible = (*jniEnv)->FindClass(jniEnv,
@@ -438,6 +442,7 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *jvm, void *reserve)
if (jvm == NULL)
{
g_error("JavaVM pointer was NULL when initializing library");
+ return JNI_ERR;
}
cachedJVM = jvm;
return JNI_VERSION_1_6;
@@ -490,7 +495,6 @@ jaw_util_get_jni_env(void)
return NULL;
}
-
void
jaw_util_detach(void)
{
@@ -933,3 +937,6 @@ jaw_util_get_rect_info (JNIEnv *jniEnv,
(*height) = (gint)(*jniEnv)->GetIntField(jniEnv, jrect, jfidHeight);
}
+#ifdef __cplusplus
+}
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]