forked from AuroraMiddleware/gtk
Fix leaks in tests
All the list model tests were leaking items, because g_list_model_get_item is transfer full. Fixing these unveils a crash in the treelistmodel and maplistmodel tests.
This commit is contained in:
parent
33a8ef4bce
commit
168c1f440d
@ -29,8 +29,11 @@ get (GListModel *model,
|
||||
guint position)
|
||||
{
|
||||
GObject *object = g_list_model_get_item (model, position);
|
||||
guint number;
|
||||
g_assert (object != NULL);
|
||||
return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
number = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
g_object_unref (object);
|
||||
return number;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -29,8 +29,11 @@ get (GListModel *model,
|
||||
guint position)
|
||||
{
|
||||
GObject *object = g_list_model_get_item (model, position);
|
||||
guint number;
|
||||
g_assert (object != NULL);
|
||||
return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
number = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
g_object_unref (object);
|
||||
return number;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -29,8 +29,11 @@ get (GListModel *model,
|
||||
guint position)
|
||||
{
|
||||
GObject *object = g_list_model_get_item (model, position);
|
||||
guint number;
|
||||
g_assert (object != NULL);
|
||||
return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
number = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
g_object_unref (object);
|
||||
return number;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -28,8 +28,11 @@ get (GListModel *model,
|
||||
guint position)
|
||||
{
|
||||
GObject *object = g_list_model_get_item (model, position);
|
||||
guint number;
|
||||
g_assert (object != NULL);
|
||||
return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
number = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
g_object_unref (object);
|
||||
return number;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -29,8 +29,11 @@ get (GListModel *model,
|
||||
guint position)
|
||||
{
|
||||
GObject *object = g_list_model_get_item (model, position);
|
||||
guint number;
|
||||
g_assert (object != NULL);
|
||||
return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
number = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
g_object_unref (object);
|
||||
return number;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
@ -29,8 +29,11 @@ get (GListModel *model,
|
||||
guint position)
|
||||
{
|
||||
GObject *object = g_list_model_get_item (model, position);
|
||||
guint number;
|
||||
g_assert (object != NULL);
|
||||
return GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
number = GPOINTER_TO_UINT (g_object_get_qdata (object, number_quark));
|
||||
g_object_unref (object);
|
||||
return number;
|
||||
}
|
||||
|
||||
static char *
|
||||
|
Loading…
Reference in New Issue
Block a user