From 29e88b08d8875aa3f259698fc66553863bc169d8 Mon Sep 17 00:00:00 2001 From: Julian Winkler Date: Fri, 3 Nov 2023 21:53:53 +0100 Subject: [PATCH] AndroidLayout: ignore exceptions during measure This fixes a crash with the Flower Finder test apk, where ActionBarContextView doesn't allow MEASURE_SPEC_UNSPECIFIED --- src/api-impl-jni/views/AndroidLayout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/api-impl-jni/views/AndroidLayout.c b/src/api-impl-jni/views/AndroidLayout.c index dc0333fe..6dcfdc68 100644 --- a/src/api-impl-jni/views/AndroidLayout.c +++ b/src/api-impl-jni/views/AndroidLayout.c @@ -34,8 +34,10 @@ static void android_layout_measure(GtkLayoutManager *layout_manager, GtkWidget * heightMeasureSpec = _GET_INT_FIELD(layout->view, "oldHeightMeasureSpec"); if (widthMeasureSpec != -1 && heightMeasureSpec != -1) { (*env)->CallVoidMethod(env, layout->view, handle_cache.view.measure, widthMeasureSpec, heightMeasureSpec); - if((*env)->ExceptionCheck(env)) + if((*env)->ExceptionCheck(env)) { (*env)->ExceptionDescribe(env); + (*env)->ExceptionClear(env); + } } }