]> Pileus Git - grits/blobdiff - src/objects/gis-tile.c
GisTile: use g_object_unref instead of g_free
[grits] / src / objects / gis-tile.c
index d11af4f3f72f8f51ebc3be6c30fcac259de97a5c..14430f45bfbac4f95ab92af87713aeadee265da2 100644 (file)
@@ -47,8 +47,8 @@ gchar *gis_tile_get_path(GisTile *child)
                        if (parent->children[x][y] == child)
                                parts = g_list_prepend(parts, gis_tile_path_table[x][y]);
        GString *path = g_string_new("");
-       for (; parts; parts = parts->next)
-               g_string_append(path, parts->data);
+       for (GList *cur = parts; cur; cur = cur->next)
+               g_string_append(path, cur->data);
        g_list_free(parts);
        return g_string_free(path, FALSE);
 }
@@ -173,12 +173,13 @@ GisTile *gis_tile_gc(GisTile *self, time_t atime,
        //              self, (guint)self->atime, (guint)atime);
        if (!has_children && self->atime < atime && self->data) {
                free_func(self, user_data);
-               g_free(self);
+               g_object_unref(self);
                return NULL;
        }
        return self;
 }
 
+/* Use GObject for this */
 void gis_tile_free(GisTile *self, GisTileFreeFunc free_func, gpointer user_data)
 {
        if (!self)