macos: Stop using g_slice

This commit is contained in:
Matthias Clasen 2023-03-03 06:33:36 -05:00
parent 6f93baf420
commit 15d73a1adb
3 changed files with 6 additions and 6 deletions

View File

@ -283,7 +283,7 @@ static void
push_nsevent (GdkEvent *gdk_event,
NSEvent *nsevent)
{
GdkToNSEventMap *map = g_slice_new0 (GdkToNSEventMap);
GdkToNSEventMap *map = g_new0 (GdkToNSEventMap, 1);
map->link.data = map;
map->gdk_event = gdk_event_ref (gdk_event);
@ -297,7 +297,7 @@ push_nsevent (GdkEvent *gdk_event,
gdk_event_unref (map->gdk_event);
[map->nsevent release];
g_slice_free (GdkToNSEventMap, map);
g_free (map);
}
}

View File

@ -66,7 +66,7 @@ gdk_macos_zoomback_destroy (GdkMacosZoomback *zb)
{
gdk_surface_hide (GDK_SURFACE (zb->drag->drag_surface));
g_clear_object (&zb->drag);
g_slice_free (GdkMacosZoomback, zb);
g_free (zb);
}
static gboolean
@ -157,7 +157,7 @@ gdk_macos_drag_drop_done (GdkDrag *drag,
/* Apple HIG suggests doing a "zoomback" animation of the surface back
* towards the original position.
*/
zb = g_slice_new0 (GdkMacosZoomback);
zb = g_new0 (GdkMacosZoomback, 1);
zb->drag = g_object_ref (self);
zb->frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self->drag_surface));
zb->start_time = gdk_frame_clock_get_frame_time (zb->frame_clock);

View File

@ -423,7 +423,7 @@ write_request_free (WriteRequest *wr)
g_clear_pointer (&wr->main_context, g_main_context_unref);
g_clear_object (&wr->stream);
[wr->item release];
g_slice_free (WriteRequest, wr);
g_free (wr);
}
static void
@ -491,7 +491,7 @@ on_data_ready_cb (GObject *object,
return;
}
wr = g_slice_new0 (WriteRequest);
wr = g_new0 (WriteRequest, 1);
wr->item = [item retain];
wr->stream = G_MEMORY_OUTPUT_STREAM (g_memory_output_stream_new_resizable ());
wr->type = type;