mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
androidmedia: Clear the exception before trying to call Java methods to convert it to a string
This commit is contained in:
parent
0c93a82861
commit
40fb09544f
1 changed files with 6 additions and 1 deletions
|
@ -499,16 +499,21 @@ gst_amc_set_error_string (JNIEnv * env, GQuark domain, gint code, GError ** err,
|
|||
if ((exception = (*env)->ExceptionOccurred (env))) {
|
||||
gchar *exception_description, *exception_stacktrace;
|
||||
|
||||
/* Clear exception so that we can call Java methods again */
|
||||
(*env)->ExceptionClear (env);
|
||||
|
||||
exception_description = getExceptionSummary (env, exception);
|
||||
exception_stacktrace = getStackTrace (env, exception);
|
||||
g_set_error (err, domain, code, "%s: %s\n%s", message,
|
||||
exception_description, exception_stacktrace);
|
||||
g_free (exception_description);
|
||||
g_free (exception_stacktrace);
|
||||
|
||||
(*env)->DeleteLocalRef (env, exception);
|
||||
} else {
|
||||
(*env)->ExceptionClear (env);
|
||||
g_set_error (err, domain, code, "%s", message);
|
||||
}
|
||||
(*env)->ExceptionClear (env);
|
||||
} else {
|
||||
g_set_error (err, domain, code, "%s", message);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue