static bool _muse_core_ipc_msg_complete_confirm(muse_client_h client, char *msg, int msg_len);
static bool _muse_core_ipc_init_bufmgr(void);
static void _muse_core_ipc_deinit_bufmgr(void);
-static void _muse_core_ipc_client_free(gpointer key, gpointer value, gpointer user_data);
+static gboolean _muse_core_ipc_free_key(gpointer key, gpointer value, gpointer user_data);
static void _muse_core_ipc_free(void);
static void _muse_core_ipc_init_instance(void (*free)(void));
static int _muse_core_ipc_check_fd(int fd);
g_return_if_fail(module != NULL);
muse_core_log_get_instance()->flush_msg();
- g_hash_table_foreach(g_muse_core_ipc->client_table, (GHFunc)_muse_core_ipc_client_free, NULL);
+ g_hash_table_foreach_remove(g_muse_core_ipc->client_table, _muse_core_ipc_free_key, NULL);
g_queue_free(module->ch[MUSE_CHANNEL_DATA].queue);
module->ch[MUSE_CHANNEL_DATA].queue = NULL;
g_hash_table_insert(g_muse_core_ipc->client_table, g_muse_core_ipc->key, (gpointer)client);
}
-static void _muse_core_ipc_client_free(gpointer key, gpointer value, gpointer user_data)
+static gboolean _muse_core_ipc_free_key(gpointer key, gpointer value, gpointer user_data)
{
- g_hash_table_remove(g_muse_core_ipc->client_table, key);
+ g_free(key);
+ return TRUE;
}
static void _muse_core_ipc_free(void)
static GModule *_muse_core_module_load(int api_module);
static void _muse_core_module_dispatch(int cmd, muse_module_h module);
static gboolean _muse_core_module_close(muse_module_h module);
+static gboolean _muse_core_module_free_key(gpointer key, gpointer value, gpointer user_data);
static void _muse_core_module_free(void);
static GModule *_muse_core_module_get_dllsymbol(int api_module);
static void _muse_core_module_set_dllsymbol_loaded_value(int api_module, GModule *module, gboolean value);
}
}
+static gboolean _muse_core_module_free_key(gpointer key, gpointer value, gpointer user_data)
+{
+ g_free(key);
+ return TRUE;
+}
+
static void _muse_core_module_free(void)
{
int idx = 0;
for (idx = 0; idx < MUSE_MODULE_MAX; idx++) {
g_module_close(g_muse_core_module->module[idx]);
+ g_hash_table_foreach_remove(g_muse_core_module->table[idx], _muse_core_module_free_key, NULL);
g_hash_table_destroy(g_muse_core_module->table[idx]);
}