diff options
| author | Dana Jansens <danakj@orodu.net> | 2010-02-12 14:03:24 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2010-02-12 14:03:24 -0500 |
| commit | 890e13b919892887b773462bb866e849e0cb4d91 (patch) | |
| tree | 3abd5c781bb2cedddb061e34a8057fe146a49794 /obt/xml.c | |
| parent | 4f93731cdbecbf43b82aa000c07ec8b40f97dd03 (diff) | |
use g_slice_new() instead of g_new() part 3
Diffstat (limited to 'obt/xml.c')
| -rw-r--r-- | obt/xml.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -52,12 +52,12 @@ struct _ObtXmlInst { static void destfunc(struct Callback *c) { g_free(c->tag); - g_free(c); + g_slice_free(struct Callback, c); } ObtXmlInst* obt_xml_instance_new(void) { - ObtXmlInst *i = g_new(ObtXmlInst, 1); + ObtXmlInst *i = g_slice_new(ObtXmlInst); i->ref = 1; i->xdg_paths = obt_paths_new(); i->callbacks = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, @@ -78,7 +78,7 @@ void obt_xml_instance_unref(ObtXmlInst *i) if (i && --i->ref == 0) { obt_paths_unref(i->xdg_paths); g_hash_table_destroy(i->callbacks); - g_free(i); + g_slice_free(ObtXmlInst, i); } } @@ -104,7 +104,7 @@ void obt_xml_register(ObtXmlInst *i, const gchar *tag, return; } - c = g_new(struct Callback, 1); + c = g_slice_new(struct Callback); c->tag = g_strdup(tag); c->func = func; c->data = data; |
