@@ -961,6 +961,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_getRGBPixelsImpl
961
961
const gchar * token = jtoken
962
962
? (* env )-> GetStringUTFChars (env , jtoken , NULL )
963
963
: NULL ;
964
+ JNU_CHECK_EXCEPTION_RETURN (env , RESULT_ERROR );
964
965
965
966
isGtkMainThread = gtk -> g_main_context_is_owner (gtk -> g_main_context_default ());
966
967
DEBUG_SCREENCAST (
@@ -1066,7 +1067,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopMou
1066
1067
const gchar * token = jtoken
1067
1068
? (* env )-> GetStringUTFChars (env , jtoken , NULL )
1068
1069
: NULL ;
1069
-
1070
+ JNU_CHECK_EXCEPTION_RETURN ( env , RESULT_ERROR );
1070
1071
1071
1072
DEBUG_SCREENCAST ("moving mouse to\n\t%d %d\n\twith token |%s|\n" , jx , jy , token );
1072
1073
@@ -1096,6 +1097,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopMou
1096
1097
const gchar * token = jtoken
1097
1098
? (* env )-> GetStringUTFChars (env , jtoken , NULL )
1098
1099
: NULL ;
1100
+ JNU_CHECK_EXCEPTION_RETURN (env , RESULT_ERROR );
1099
1101
1100
1102
gboolean result = initPortal (token , NULL , 0 );
1101
1103
DEBUG_SCREENCAST ("init result %b, mouse pressing %d\n" , result , buttons )
@@ -1123,6 +1125,7 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopMou
1123
1125
const gchar * token = jtoken
1124
1126
? (* env )-> GetStringUTFChars (env , jtoken , NULL )
1125
1127
: NULL ;
1128
+ JNU_CHECK_EXCEPTION_RETURN (env , RESULT_ERROR );
1126
1129
1127
1130
gboolean result = initPortal (token , NULL , 0 );
1128
1131
DEBUG_SCREENCAST ("init result %b, mouse wheel %d\n" , result , jWheelAmt )
@@ -1151,13 +1154,14 @@ JNIEXPORT jint JNICALL Java_sun_awt_screencast_ScreencastHelper_remoteDesktopKey
1151
1154
int key = awt_getX11KeySym (jkey );
1152
1155
AWT_UNLOCK ();
1153
1156
1154
- if (key == NoSymbol ) {
1157
+ if (key == NoSymbol || ( * env ) -> ExceptionCheck ( env ) ) {
1155
1158
return RESULT_ERROR ;
1156
1159
}
1157
1160
1158
1161
const gchar * token = jtoken
1159
1162
? (* env )-> GetStringUTFChars (env , jtoken , NULL )
1160
1163
: NULL ;
1164
+ JNU_CHECK_EXCEPTION_RETURN (env , RESULT_ERROR );
1161
1165
1162
1166
gboolean result = initPortal (token , NULL , 0 );
1163
1167
DEBUG_SCREENCAST ("init result %b, key %d -> %d isPress %b\n" , result , jkey , key , isPress )
0 commit comments