diff options
-rw-r--r-- | src/application.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/application.c b/src/application.c index 38904c8..4d4c815 100644 --- a/src/application.c +++ b/src/application.c @@ -84,7 +84,8 @@ mq_application_new(const gchar *profile, gboolean G_GNUC_UNUSED private) application->config = mq_config_new(profile); mq_config_load(application->config); application->windows = NULL; - application->tabs = g_hash_table_new(g_int64_hash, g_int64_equal); + application->tabs = g_hash_table_new_full(g_int64_hash, g_int64_equal, + g_free, NULL); application->last_tab_id = 0; application->marquee_mode = FALSE; @@ -251,9 +252,11 @@ mq_application_delete_window(MqApplication *application, MqWindow *window) gint64 mq_application_register_tab(MqApplication *application, MqTabPage *tab_page) { - ++application->last_tab_id; - g_hash_table_insert(application->tabs, &application->last_tab_id, - tab_page); + gint64 *tab_id; + + tab_id = g_new(gint64, 1); + *tab_id = ++application->last_tab_id; + g_hash_table_insert(application->tabs, tab_id, tab_page); return application->last_tab_id; } |