static void termit_del_tab() { gint page = gtk_notebook_get_current_page(GTK_NOTEBOOK(termit.notebook)); TERMIT_GET_TAB_BY_INDEX(pTab, page); TRACE("%s pid=%d", __FUNCTION__, pTab->pid); g_array_free(pTab->matches, TRUE); g_free(pTab->encoding); g_free(pTab->command); g_free(pTab->title); termit_style_free(&pTab->style); g_free(pTab); gtk_notebook_remove_page(GTK_NOTEBOOK(termit.notebook), page); termit_check_single_tab(); }
void termit_config_deinit() { g_free(configs.default_window_title); g_free(configs.default_tab_name); termit_style_free(&configs.style); g_free(configs.default_command); g_free(configs.default_encoding); g_free(configs.default_word_chars); free_menu(configs.user_menus); g_array_free(configs.user_menus, TRUE); free_menu(configs.user_popup_menus); g_array_free(configs.user_popup_menus, TRUE); // name and default_binding are static (e.g. can be in readonly mempage) guint i = 0; for (; i<configs.key_bindings->len; ++i) { struct KeyBinding* kb = &g_array_index(configs.key_bindings, struct KeyBinding, i); termit_lua_unref(&kb->lua_callback); } g_array_free(configs.key_bindings, TRUE); i = 0; for (; i<configs.mouse_bindings->len; ++i) { struct MouseBinding* mb = &g_array_index(configs.mouse_bindings, struct MouseBinding, i); termit_lua_unref(&mb->lua_callback); } g_array_free(configs.mouse_bindings, TRUE); i = 0; for (; i<configs.matches->len; ++i) { struct Match* match = &g_array_index(configs.matches, struct Match, i); g_regex_unref(match->regex); g_free(match->pattern); } g_array_free(configs.matches, TRUE); termit_lua_unref(&configs.get_window_title_callback); termit_lua_unref(&configs.get_tab_title_callback); termit_lua_unref(&configs.get_statusbar_callback); }
static void termit_dlg_helper_free(struct TermitDlgHelper* hlp) { g_free(hlp->tab_title); termit_style_free(&hlp->style); g_free(hlp); }