Handler *handler_new(void)
{
- Handler *h = g_slice_new(Handler);
+ Handler *h = g_new(Handler, 1);
h->table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
return h;
g_hash_table_destroy(h->table);
h->table = NULL;
}
- g_slice_free(Handler, h);
+ g_free(h);
}
gboolean handler_add(Handler *h, const char *key, const char *cmd)
Shortcut *shortcut_new()
{
- Shortcut *sc = g_slice_new(Shortcut);
+ Shortcut *sc = g_new(Shortcut, 1);
sc->table = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
sc->fallback = NULL;
if (sc->table) {
g_hash_table_destroy(sc->table);
}
- g_slice_free(Shortcut, sc);
+ g_free(sc);
}
gboolean shortcut_add(Shortcut *sc, const char *key, const char *uri)