mirror of
https://github.com/profanity-im/profanity.git
synced 2024-11-03 19:37:16 -05:00
Free hash table keys before modifying hash table
This commit is contained in:
parent
1a98f1404b
commit
75f791da8f
@ -408,9 +408,9 @@ wins_new_xmlconsole(void)
|
|||||||
{
|
{
|
||||||
GList *keys = g_hash_table_get_keys(windows);
|
GList *keys = g_hash_table_get_keys(windows);
|
||||||
int result = get_next_available_win_num(keys);
|
int result = get_next_available_win_num(keys);
|
||||||
|
g_list_free(keys);
|
||||||
ProfWin *newwin = win_create_xmlconsole();
|
ProfWin *newwin = win_create_xmlconsole();
|
||||||
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
||||||
g_list_free(keys);
|
|
||||||
return newwin;
|
return newwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -419,9 +419,9 @@ wins_new_chat(const char * const barejid)
|
|||||||
{
|
{
|
||||||
GList *keys = g_hash_table_get_keys(windows);
|
GList *keys = g_hash_table_get_keys(windows);
|
||||||
int result = get_next_available_win_num(keys);
|
int result = get_next_available_win_num(keys);
|
||||||
|
g_list_free(keys);
|
||||||
ProfWin *newwin = win_create_chat(barejid);
|
ProfWin *newwin = win_create_chat(barejid);
|
||||||
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
||||||
g_list_free(keys);
|
|
||||||
return newwin;
|
return newwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,9 +430,9 @@ wins_new_muc(const char * const roomjid)
|
|||||||
{
|
{
|
||||||
GList *keys = g_hash_table_get_keys(windows);
|
GList *keys = g_hash_table_get_keys(windows);
|
||||||
int result = get_next_available_win_num(keys);
|
int result = get_next_available_win_num(keys);
|
||||||
|
g_list_free(keys);
|
||||||
ProfWin *newwin = win_create_muc(roomjid);
|
ProfWin *newwin = win_create_muc(roomjid);
|
||||||
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
||||||
g_list_free(keys);
|
|
||||||
return newwin;
|
return newwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -441,9 +441,9 @@ wins_new_muc_config(const char * const roomjid, DataForm *form)
|
|||||||
{
|
{
|
||||||
GList *keys = g_hash_table_get_keys(windows);
|
GList *keys = g_hash_table_get_keys(windows);
|
||||||
int result = get_next_available_win_num(keys);
|
int result = get_next_available_win_num(keys);
|
||||||
|
g_list_free(keys);
|
||||||
ProfWin *newwin = win_create_muc_config(roomjid, form);
|
ProfWin *newwin = win_create_muc_config(roomjid, form);
|
||||||
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
||||||
g_list_free(keys);
|
|
||||||
return newwin;
|
return newwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -452,9 +452,9 @@ wins_new_private(const char * const fulljid)
|
|||||||
{
|
{
|
||||||
GList *keys = g_hash_table_get_keys(windows);
|
GList *keys = g_hash_table_get_keys(windows);
|
||||||
int result = get_next_available_win_num(keys);
|
int result = get_next_available_win_num(keys);
|
||||||
|
g_list_free(keys);
|
||||||
ProfWin *newwin = win_create_private(fulljid);
|
ProfWin *newwin = win_create_private(fulljid);
|
||||||
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
g_hash_table_insert(windows, GINT_TO_POINTER(result), newwin);
|
||||||
g_list_free(keys);
|
|
||||||
return newwin;
|
return newwin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user