diff options
| author | Po Lu | 2023-02-20 11:56:13 +0800 |
|---|---|---|
| committer | Po Lu | 2023-02-20 11:56:13 +0800 |
| commit | fecd0a9fed2f392dc0c5f852b705758681ef5266 (patch) | |
| tree | b3e8a3a4828a5b6c3093f00b505871f579dd8a38 /src | |
| parent | ba87d2c28b1366083e96650fa3ede7041f44067e (diff) | |
| download | emacs-fecd0a9fed2f392dc0c5f852b705758681ef5266.tar.gz emacs-fecd0a9fed2f392dc0c5f852b705758681ef5266.zip | |
Fix crash inside font-list-family
* src/androidfont.c (androidfont_list_family): Don't
unconditionally initialize the Android font driver.
Diffstat (limited to 'src')
| -rw-r--r-- | src/androidfont.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/androidfont.c b/src/androidfont.c index 55f45758352..9da82b670fd 100644 --- a/src/androidfont.c +++ b/src/androidfont.c | |||
| @@ -1027,18 +1027,19 @@ androidfont_list_family (struct frame *f) | |||
| 1027 | jsize i, length; | 1027 | jsize i, length; |
| 1028 | const char *family; | 1028 | const char *family; |
| 1029 | 1029 | ||
| 1030 | /* Maybe initialize the font driver. */ | 1030 | /* Return if the Android font driver is not initialized. Loading |
| 1031 | androidfont_check_init (); | 1031 | every font under Android takes a non trivial amount of memory, |
| 1032 | and is not something that should be done when the user tries to | ||
| 1033 | list all of the font families. */ | ||
| 1034 | |||
| 1035 | if (!font_driver) | ||
| 1036 | return Qnil; | ||
| 1032 | 1037 | ||
| 1033 | family_array | 1038 | family_array |
| 1034 | = (*android_java_env)->CallObjectMethod (android_java_env, | 1039 | = (*android_java_env)->CallObjectMethod (android_java_env, |
| 1035 | font_driver, | 1040 | font_driver, |
| 1036 | font_driver_class.list_families); | 1041 | font_driver_class.list_families); |
| 1037 | if (!family_array) | 1042 | android_exception_check (); |
| 1038 | { | ||
| 1039 | (*android_java_env)->ExceptionClear (android_java_env); | ||
| 1040 | memory_full (0); | ||
| 1041 | } | ||
| 1042 | 1043 | ||
| 1043 | length = (*android_java_env)->GetArrayLength (android_java_env, | 1044 | length = (*android_java_env)->GetArrayLength (android_java_env, |
| 1044 | family_array); | 1045 | family_array); |