diff options
| author | Eric Williams | 2017-11-22 16:38:55 +0000 |
|---|---|---|
| committer | Eric Williams | 2017-11-23 16:19:16 +0000 |
| commit | 28cccc6c31636d2dfce20e6fd2b67b306db0ddbb (patch) | |
| tree | e966a5696af7e208124601afeb4795ea3a4299c9 | |
| parent | 84243edce3271ce277188355c0302a31c8554abd (diff) | |
| download | eclipse.platform.swt-28cccc6c31636d2dfce20e6fd2b67b306db0ddbb.tar.gz eclipse.platform.swt-28cccc6c31636d2dfce20e6fd2b67b306db0ddbb.tar.xz eclipse.platform.swt-28cccc6c31636d2dfce20e6fd2b67b306db0ddbb.zip | |
Bug 527536: [GTK3] NoSuchMethodError: gObjectClass_finalize
Call AccessibleObject.gObjectClass_finalize only if the
SwtFixedAccessible instance has a matching Java accessible object. Chain
up to the parent in os_custom.c for all cases anyways.
This patch guards the method ID lookup as well, and returns 0 if there
is an issue. This way it should be impossible to get a NoSuchMethodError
thrown.
Change-Id: I285666e07e66adc2c677964b3d8d4c4bde29b6b2
Signed-off-by: Eric Williams <ericwill@redhat.com>
| -rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c index 11344fc731..6b16c80c3c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/os_custom.c @@ -830,12 +830,16 @@ AtkObject *swt_fixed_accessible_new (GtkWidget *widget) { } static void swt_fixed_accessible_finalize (GObject *object) { + SwtFixedAccessible *fixed = SWT_FIXED_ACCESSIBLE (object); + SwtFixedAccessiblePrivate *private = fixed->priv; jintLong returned_value = 0; // Call the Java implementation to ensure AccessibleObjects are removed // from the HashMap on the Java side. - returned_value = call_accessible_object_function("gObjectClass_finalize", "(J)J", object); - if (returned_value != 0) g_critical ("Undefined behavior calling gObjectClass_finalize from C\n"); + if (private->has_accessible) { + returned_value = call_accessible_object_function("gObjectClass_finalize", "(J)J", object); + if (returned_value != 0) g_critical ("Undefined behavior calling gObjectClass_finalize from C\n"); + } // Chain up to the parent class G_OBJECT_CLASS (swt_fixed_accessible_parent_class)->finalize (object); @@ -1812,6 +1816,7 @@ jintLong call_accessible_object_function (const char *method_name, const char *m // If the method ID isn't NULL if (mid == NULL) { g_critical("JNI method ID pointer is NULL for method %s\n", method_name); + return 0; } else { va_start(arg_list, method_signature); result = (*env)->CallStaticLongMethodV(env, cls, mid, arg_list); |
