Fix emulator crash on exit, due to invalid free() call.
diff --git a/android/charmap.c b/android/charmap.c
index 23f65fa..a313312 100644
--- a/android/charmap.c
+++ b/android/charmap.c
@@ -263,7 +263,7 @@
};
/* Custom character map created with -charmap option. */
-AKeyCharmap android_custom_charmap = { 0 };
+static AKeyCharmap android_custom_charmap = { 0 };
const AKeyCharmap** android_charmaps = 0;
int android_charmap_count = 0;
@@ -721,15 +721,6 @@
void
android_charmap_done(void) {
if (NULL != android_charmaps) {
- int n;
- for (n = 0; n < android_charmap_count; n++) {
- // Entries for qwerty and qwerty2 character maps are
- // static entries defined in charmap.c
- if ((&_qwerty_charmap != android_charmaps[n]->entries) &&
- (&_qwerty2_charmap != android_charmaps[n]->entries)) {
- qemu_free((void*)android_charmaps[n]->entries);
- }
- }
qemu_free(android_charmaps);
}
}
diff --git a/android/charmap.h b/android/charmap.h
index 7f1e959..3d34224 100644
--- a/android/charmap.h
+++ b/android/charmap.h
@@ -39,9 +39,6 @@
/* Number of entries in android_charmaps array. */
extern int android_charmap_count;
-/* Custom character map created with -charmap option. */
-extern AKeyCharmap android_custom_charmap;
-
/* Extracts charmap name from .kcm file name.
* Charmap name, extracted by this routine is a name of the kcm file, trimmed
* of file name extension, and shrinked (if necessary) to fit into the name