st-texture-cache: Add one simple way to free texture load data

https://bugzilla.gnome.org/show_bug.cgi?id=692845
This commit is contained in:
Jasper St. Pierre 2013-02-14 16:04:03 -05:00
parent f1cdce38a6
commit a5d3f7785a

View File

@ -299,7 +299,7 @@ typedef struct {
} AsyncTextureLoadData; } AsyncTextureLoadData;
static void static void
texture_load_data_destroy (gpointer p) texture_load_data_free (gpointer p)
{ {
AsyncTextureLoadData *data = p; AsyncTextureLoadData *data = p;
@ -317,6 +317,8 @@ texture_load_data_destroy (gpointer p)
if (data->textures) if (data->textures)
g_slist_free_full (data->textures, (GDestroyNotify) g_object_unref); g_slist_free_full (data->textures, (GDestroyNotify) g_object_unref);
g_free (data);
} }
/** /**
@ -677,8 +679,7 @@ out:
if (texdata) if (texdata)
cogl_handle_unref (texdata); cogl_handle_unref (texdata);
texture_load_data_destroy (data); texture_load_data_free (data);
g_free (data);
g_clear_error (&error); g_clear_error (&error);
} }