void completion_clean(void)
{
- for (GList *l = vp.comps.completions; l; l = l->next) {
- g_free(l->data);
- }
- g_list_free(vp.comps.completions);
+ g_list_free_full(vp.comps.completions, (GDestroyNotify)g_free);
if (vp.gui.compbox) {
gtk_widget_destroy(vp.gui.compbox);
void history_cleanup(void)
{
- g_list_free(vp.state.history);
+ g_list_free_full(vp.state.history, (GDestroyNotify)g_free);
}
void history_append(const char* line)
static guint keybind_str_to_modmask(const char* str);
static guint keybind_str_to_value(const char* str);
static gboolean keybind_keypress_callback(WebKitWebView* webview, GdkEventKey* event);
+static void keybind_free(Keybind* keybind);
void keybind_init(void)
void keybind_cleanup(void)
{
if (vp.behave.keys) {
- g_slist_free(vp.behave.keys);
+ g_slist_free_full(vp.behave.keys, (GDestroyNotify)keybind_free);
}
if (vp.behave.modkeys) {
g_string_free(vp.behave.modkeys, TRUE);
return FALSE;
}
+
+static void keybind_free(Keybind* keybind)
+{
+ g_free(keybind->command);
+ g_free(keybind->param);
+ g_free(keybind);
+}
static GSList* searchengine_find(const char* handle);
static gboolean searchengine_is_valid_uri(const char* uri);
+static void searchengine_free(Searchengine* se);
void searchengine_cleanup(void)
{
if (vp.behave.searchengines) {
- g_slist_free(vp.behave.searchengines);
+ g_slist_free_full(vp.behave.searchengines, (GDestroyNotify)searchengine_free);
}
}
return count == 1;
}
+
+static void searchengine_free(Searchengine* se)
+{
+ g_free(se->uri);
+ g_free(se->handle);
+ g_free(se);
+}