tests: Stop using g_slice

This commit is contained in:
Matthias Clasen 2023-03-03 06:53:53 -05:00
parent fe79c7db16
commit 61d53b6402
3 changed files with 7 additions and 7 deletions

View File

@ -222,7 +222,7 @@ row_data_free (gpointer _data)
row_data_unbind (data);
g_slice_free (RowData, data);
g_free (data);
}
static void
@ -232,7 +232,7 @@ setup_widget (GtkListItem *list_item,
GtkWidget *box, *child;
RowData *data;
data = g_slice_new0 (RowData);
data = g_new0 (RowData, 1);
g_signal_connect (list_item, "notify::item", G_CALLBACK (row_data_notify_item), data);
g_object_set_data_full (G_OBJECT (list_item), "row-data", data, row_data_free);

View File

@ -479,7 +479,7 @@ row_data_free (gpointer _data)
row_data_unbind (data);
g_slice_free (RowData, data);
g_free (data);
}
static void
@ -489,7 +489,7 @@ setup_widget (GtkSignalListItemFactory *factory,
GtkWidget *box, *child;
RowData *data;
data = g_slice_new0 (RowData);
data = g_new0 (RowData, 1);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_list_item_set_child (list_item, box);

View File

@ -107,7 +107,7 @@ create_frames_thread (gpointer data)
while (TRUE)
{
FrameData *frame_data = g_slice_new0 (FrameData);
FrameData *frame_data = g_new0 (FrameData, 1);
frame_data->angle = 2 * M_PI * (frame_count % fps) / (double)fps;
frame_data->stream_time = (G_GINT64_CONSTANT (1000000) * frame_count) / fps;
@ -266,7 +266,7 @@ collect_old_frames (void)
if (remove)
{
past_frames = g_list_delete_link (past_frames, l);
g_slice_free (FrameData, frame_data);
g_free (frame_data);
}
}
}
@ -329,7 +329,7 @@ on_update (GdkFrameClock *frame_clock,
stream_time_to_clock_time (next_frame->stream_time)
< predicted_presentation_time + refresh_interval / 2)
{
g_slice_free (FrameData, unqueue_frame ());
g_free (unqueue_frame ());
n_frames++;
dropped_frames++;
pending_frame = next_frame;