From 72758ef34bffea1d55b61a5362392b40cd8963de Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Fri, 8 Dec 2017 17:57:56 +0300 Subject: [PATCH] sim: Don't submit parallel EFpl reads In addition to not doing unnecessary SIM I/O, this fixes memory leaks like this one: ==10096== 74 (56 direct, 18 indirect) bytes in 2 blocks are definitely lost in loss record 1,252 of 1,342 ==10096== at 0x4841BF0: calloc (vg_replace_malloc.c) ==10096== by 0x4B03117: g_malloc0 (gmem.c) ==10096== by 0xF83DF: concat_lang_prefs (sim.c) ==10096== by 0xF8697: sim_efpl_read_cb (sim.c) ==10096== by 0x12CBF7: sim_fs_op_read_block_cb (simfs.c) --- src/sim.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sim.c b/src/sim.c index 2538c778..31df6362 100644 --- a/src/sim.c +++ b/src/sim.c @@ -2200,6 +2200,9 @@ static void sim_efli_efpl_changed(int id, void *userdata) if (sim->efli != NULL) /* This shouldn't happen */ return; + if (sim->language_prefs_update) + return; + if (sim->language_prefs) { g_strfreev(sim->language_prefs); sim->language_prefs = NULL;