1
0
Fork 0

src: Stop using GSlice

It has been inofficially deprecated for years, is known to cause issues
with valgrind and potentially hides memory corruption.
Lets stop using it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1512>
This commit is contained in:
Robert Mader 2020-10-19 19:57:57 +02:00
parent 8b977e9046
commit 6eeeffdc68
39 changed files with 91 additions and 91 deletions

View file

@ -356,7 +356,7 @@ meta_barrier_event_unref (MetaBarrierEvent *event)
g_return_if_fail (event->ref_count > 0);
if (g_atomic_int_dec_and_test ((volatile int *)&event->ref_count))
g_slice_free (MetaBarrierEvent, event);
g_free (event);
}
G_DEFINE_BOXED_TYPE (MetaBarrierEvent,

View file

@ -83,7 +83,7 @@ destroy_dbus_watch (gpointer data)
g_free (watch->dbus_name);
g_bus_unwatch_name (watch->name_watcher_id);
g_slice_free (DBusWatch, watch);
g_free (watch);
}
static void
@ -120,7 +120,7 @@ make_dbus_watch (MetaDBusIdleMonitor *skeleton,
{
DBusWatch *watch;
watch = g_slice_new (DBusWatch);
watch = g_new0 (DBusWatch, 1);
watch->dbus_monitor = g_object_ref (skeleton);
watch->monitor = g_object_ref (monitor);
watch->dbus_name = g_strdup (g_dbus_method_invocation_get_sender (invocation));

View file

@ -167,7 +167,7 @@ free_watch (gpointer data)
g_source_destroy (watch->timeout_source);
g_object_unref (monitor);
g_slice_free (MetaIdleMonitorWatch, watch);
g_free (watch);
}
static void
@ -329,7 +329,7 @@ make_watch (MetaIdleMonitor *monitor,
{
MetaIdleMonitorWatch *watch;
watch = g_slice_new0 (MetaIdleMonitorWatch);
watch = g_new0 (MetaIdleMonitorWatch, 1);
watch->monitor = monitor;
watch->id = get_next_watch_serial ();

View file

@ -1448,7 +1448,7 @@ device_mapping_info_free (DeviceMappingInfo *info)
g_clear_signal_handler (&info->changed_id, info->settings);
g_object_unref (info->settings);
g_free (info->group_modes);
g_slice_free (DeviceMappingInfo, info);
g_free (info);
}
static gboolean
@ -1476,7 +1476,7 @@ check_add_mappable_device (MetaInputSettings *input_settings,
priv = meta_input_settings_get_instance_private (input_settings);
info = g_slice_new0 (DeviceMappingInfo);
info = g_new0 (DeviceMappingInfo, 1);
info->input_settings = input_settings;
info->device = device;
info->settings = settings;

View file

@ -252,7 +252,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
width,
height);
crtc_assignment = g_slice_new0 (MetaCrtcAssignment);
crtc_assignment = g_new0 (MetaCrtcAssignment, 1);
*crtc_assignment = (MetaCrtcAssignment) {
.crtc = crtc,
.mode = crtc_mode,
@ -280,7 +280,7 @@ assign_monitor_crtc (MetaMonitor *monitor,
else
assign_output_as_presentation = FALSE;
output_assignment = g_slice_new0 (MetaOutputAssignment);
output_assignment = g_new0 (MetaOutputAssignment, 1);
*output_assignment = (MetaOutputAssignment) {
.output = output,
.is_primary = assign_output_as_primary,
@ -1600,13 +1600,13 @@ static void
meta_crtc_assignment_free (MetaCrtcAssignment *assignment)
{
g_ptr_array_free (assignment->outputs, TRUE);
g_slice_free (MetaCrtcAssignment, assignment);
g_free (assignment);
}
static void
meta_output_assignment_free (MetaOutputAssignment *assignment)
{
g_slice_free (MetaOutputAssignment, assignment);
g_free (assignment);
}
gboolean

View file

@ -85,7 +85,7 @@ meta_overlay_new (MetaStage *stage)
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_backend);
MetaOverlay *overlay;
overlay = g_slice_new0 (MetaOverlay);
overlay = g_new0 (MetaOverlay, 1);
overlay->stage = stage;
overlay->pipeline = cogl_pipeline_new (ctx);
@ -98,7 +98,7 @@ meta_overlay_free (MetaOverlay *overlay)
if (overlay->pipeline)
cogl_object_unref (overlay->pipeline);
g_slice_free (MetaOverlay, overlay);
g_free (overlay);
}
static void

View file

@ -395,7 +395,7 @@ emit_barrier_event (MetaBarrierImplNative *self,
float dx,
float dy)
{
MetaBarrierEvent *event = g_slice_new0 (MetaBarrierEvent);
MetaBarrierEvent *event = g_new0 (MetaBarrierEvent, 1);
MetaBarrierState old_state = self->state;
switch (self->state)

View file

@ -334,7 +334,7 @@ meta_kms_callback_data_free (MetaKmsCallbackData *callback_data)
{
if (callback_data->user_data_destroy)
callback_data->user_data_destroy (callback_data->user_data);
g_slice_free (MetaKmsCallbackData, callback_data);
g_free (callback_data);
}
static int
@ -379,7 +379,7 @@ meta_kms_queue_callback (MetaKms *kms,
{
MetaKmsCallbackData *callback_data;
callback_data = g_slice_new0 (MetaKmsCallbackData);
callback_data = g_new0 (MetaKmsCallbackData, 1);
*callback_data = (MetaKmsCallbackData) {
.callback = callback,
.user_data = user_data,

View file

@ -521,7 +521,7 @@ meta_launcher_new (GError **error)
if (!seat_proxy)
goto fail;
self = g_slice_new0 (MetaLauncher);
self = g_new0 (MetaLauncher, 1);
self->session_proxy = g_object_ref (session_proxy);
self->seat_proxy = g_object_ref (seat_proxy);
self->seat_id = g_steal_pointer (&seat_id);
@ -550,7 +550,7 @@ meta_launcher_free (MetaLauncher *self)
g_object_unref (self->seat_proxy);
g_object_unref (self->session_proxy);
g_hash_table_destroy (self->impl.sysfs_fds);
g_slice_free (MetaLauncher, self);
g_free (self);
}
gboolean

View file

@ -197,7 +197,7 @@ meta_renderer_native_disconnect (CoglRenderer *cogl_renderer)
{
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
g_slice_free (CoglRendererEGL, cogl_renderer_egl);
g_free (cogl_renderer_egl);
}
static gboolean
@ -209,7 +209,7 @@ meta_renderer_native_connect (CoglRenderer *cogl_renderer,
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
MetaRendererNativeGpuData *renderer_gpu_data;
cogl_renderer->winsys = g_slice_new0 (CoglRendererEGL);
cogl_renderer->winsys = g_new0 (CoglRendererEGL, 1);
cogl_renderer_egl = cogl_renderer->winsys;
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,

View file

@ -195,7 +195,7 @@ meta_seat_impl_lookup_touch_state_in_impl (MetaSeatImpl *seat_impl,
static void
meta_touch_state_free (MetaTouchState *state)
{
g_slice_free (MetaTouchState, state);
g_free (state);
}
MetaTouchState *
@ -214,7 +214,7 @@ meta_seat_impl_acquire_touch_state_in_impl (MetaSeatImpl *seat_impl,
g_assert (!g_hash_table_contains (seat_impl->touch_states,
GINT_TO_POINTER (seat_slot)));
touch_state = g_slice_new0 (MetaTouchState);
touch_state = g_new0 (MetaTouchState, 1);
*touch_state = (MetaTouchState) {
.seat_impl = seat_impl,
.seat_slot = seat_slot,

View file

@ -136,7 +136,7 @@ static void
meta_barrier_fire_xevent (MetaBarrier *barrier,
XIBarrierEvent *xevent)
{
MetaBarrierEvent *event = g_slice_new0 (MetaBarrierEvent);
MetaBarrierEvent *event = g_new0 (MetaBarrierEvent, 1);
event->ref_count = 1;
event->event_id = xevent->eventid;

View file

@ -71,7 +71,7 @@ meta_later_unref (MetaLater *later)
later->destroy_notify = NULL;
}
g_slice_free (MetaLater, later);
g_free (later);
}
}
@ -216,7 +216,7 @@ meta_laters_add (MetaLaters *laters,
GDestroyNotify notify)
{
ClutterStage *stage = meta_compositor_get_stage (laters->compositor);
MetaLater *later = g_slice_new0 (MetaLater);
MetaLater *later = g_new0 (MetaLater, 1);
later->id = ++laters->last_later_id;
later->ref_count = 1;

View file

@ -176,7 +176,7 @@ meta_shadow_unref (MetaShadow *shadow)
cogl_object_unref (shadow->texture);
cogl_object_unref (shadow->pipeline);
g_slice_free (MetaShadow, shadow);
g_free (shadow);
}
}
@ -387,7 +387,7 @@ static void
meta_shadow_class_info_free (MetaShadowClassInfo *class_info)
{
g_free ((char *)class_info->name);
g_slice_free (MetaShadowClassInfo, class_info);
g_free (class_info);
}
static void
@ -405,7 +405,7 @@ meta_shadow_factory_init (MetaShadowFactory *factory)
for (i = 0; i < G_N_ELEMENTS (default_shadow_classes); i++)
{
MetaShadowClassInfo *class_info = g_slice_new (MetaShadowClassInfo);
MetaShadowClassInfo *class_info = g_new0 (MetaShadowClassInfo, 1);
*class_info = default_shadow_classes[i];
class_info->name = g_strdup (class_info->name);
@ -837,7 +837,7 @@ get_shadow_params (MetaShadowFactory *factory,
{
if (create)
{
class_info = g_slice_new0 (MetaShadowClassInfo);
class_info = g_new0 (MetaShadowClassInfo, 1);
*class_info = default_shadow_classes[0];
class_info->name = g_strdup (class_info->name);
@ -954,7 +954,7 @@ meta_shadow_factory_get_shadow (MetaShadowFactory *factory,
return meta_shadow_ref (shadow);
}
shadow = g_slice_new0 (MetaShadow);
shadow = g_new0 (MetaShadow, 1);
shadow->ref_count = 1;
shadow->factory = factory;

View file

@ -77,7 +77,7 @@ meta_texture_tower_new (void)
{
MetaTextureTower *tower;
tower = g_slice_new0 (MetaTextureTower);
tower = g_new0 (MetaTextureTower, 1);
return tower;
}
@ -98,7 +98,7 @@ meta_texture_tower_free (MetaTextureTower *tower)
meta_texture_tower_set_base_texture (tower, NULL);
g_slice_free (MetaTextureTower, tower);
g_free (tower);
}
/**

View file

@ -135,7 +135,7 @@ typedef struct
static void
frame_data_free (FrameData *frame)
{
g_slice_free (FrameData, frame);
g_free (frame);
}
static void
@ -451,7 +451,7 @@ meta_window_actor_x11_queue_frame_drawn (MetaWindowActor *actor,
if (meta_window_actor_is_destroyed (actor))
return;
frame = g_slice_new0 (FrameData);
frame = g_new0 (FrameData, 1);
frame->frame_counter = -1;
frame->sync_request_serial = window->sync_request_serial;

View file

@ -51,7 +51,7 @@ meta_window_shape_new (cairo_region_t *region)
int max_xspan_x2 = -1;
guint hash;
shape = g_slice_new0 (MetaWindowShape);
shape = g_new0 (MetaWindowShape, 1);
shape->ref_count = 1;
cairo_region_get_extents (region, &extents);
@ -176,7 +176,7 @@ meta_window_shape_unref (MetaWindowShape *shape)
if (shape->ref_count == 0)
{
g_free (shape->rectangles);
g_slice_free (MetaWindowShape, shape);
g_free (shape);
}
}

View file

@ -233,7 +233,7 @@ static void
free_actor_private (gpointer data)
{
if (G_LIKELY (data != NULL))
g_slice_free (ActorPrivate, data);
g_free (data);
}
static ActorPrivate *
@ -246,7 +246,7 @@ get_actor_private (MetaWindowActor *actor)
if (G_UNLIKELY (!priv))
{
priv = g_slice_new0 (ActorPrivate);
priv = g_new0 (ActorPrivate, 1);
g_object_set_qdata_full (G_OBJECT (actor),
actor_data_quark, priv,
@ -755,7 +755,7 @@ free_display_tile_preview (DisplayTilePreview *preview)
if (G_LIKELY (preview != NULL)) {
clutter_actor_destroy (preview->actor);
g_slice_free (DisplayTilePreview, preview);
g_free (preview);
}
}
@ -781,7 +781,7 @@ get_display_tile_preview (MetaDisplay *display)
display_tile_preview_data_quark);
if (!preview)
{
preview = g_slice_new0 (DisplayTilePreview);
preview = g_new0 (DisplayTilePreview, 1);
preview->actor = clutter_actor_new ();
clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);

View file

@ -129,13 +129,13 @@ static void
meta_key_binding_free (MetaKeyBinding *binding)
{
resolved_key_combo_reset (&binding->resolved_combo);
g_slice_free (MetaKeyBinding, binding);
g_free (binding);
}
static MetaKeyBinding *
meta_key_binding_copy (MetaKeyBinding *binding)
{
MetaKeyBinding *clone = g_slice_dup (MetaKeyBinding, binding);
MetaKeyBinding *clone = g_memdup2 (binding, sizeof (MetaKeyBinding));
resolved_key_combo_copy (&binding->resolved_combo,
&clone->resolved_combo);
return clone;
@ -825,7 +825,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
{
MetaKeyHandler *handler = HANDLER (pref->name);
b = g_slice_new0 (MetaKeyBinding);
b = g_new0 (MetaKeyBinding, 1);
b->name = pref->name;
b->handler = handler;
b->flags = handler->flags;
@ -848,7 +848,7 @@ rebuild_binding_table (MetaKeyBindingManager *keys,
{
MetaKeyHandler *handler = HANDLER ("external-grab");
b = g_slice_new0 (MetaKeyBinding);
b = g_new0 (MetaKeyBinding, 1);
b->name = grab->name;
b->handler = handler;
b->flags = grab->flags;
@ -1695,7 +1695,7 @@ meta_display_grab_accelerator (MetaDisplay *display,
g_hash_table_insert (external_grabs, grab->name, grab);
binding = g_slice_new0 (MetaKeyBinding);
binding = g_new0 (MetaKeyBinding, 1);
binding->name = grab->name;
binding->handler = HANDLER ("external-grab");
binding->combo = combo;

View file

@ -201,7 +201,7 @@ meta_sequence_info_new (MetaGestureTracker *tracker,
priv = meta_gesture_tracker_get_instance_private (tracker);
ms = priv->autodeny_timeout;
info = g_slice_new0 (MetaSequenceInfo);
info = g_new0 (MetaSequenceInfo, 1);
info->tracker = tracker;
info->sequence = event->touch.sequence;
info->state = META_SEQUENCE_NONE;
@ -220,7 +220,7 @@ meta_sequence_info_free (MetaSequenceInfo *info)
if (info->state == META_SEQUENCE_NONE)
meta_gesture_tracker_set_sequence_state (info->tracker, info->sequence,
META_SEQUENCE_REJECTED);
g_slice_free (MetaSequenceInfo, info);
g_free (info);
}
static gboolean

View file

@ -271,7 +271,7 @@ meta_stack_tracker_dump (MetaStackTracker *tracker)
static void
meta_stack_op_free (MetaStackOp *op)
{
g_slice_free (MetaStackOp, op);
g_free (op);
}
static int
@ -647,7 +647,7 @@ meta_stack_tracker_record_add (MetaStackTracker *tracker,
guint64 window,
gulong serial)
{
MetaStackOp *op = g_slice_new (MetaStackOp);
MetaStackOp *op = g_new0 (MetaStackOp, 1);
op->any.type = STACK_OP_ADD;
op->any.serial = serial;
@ -661,7 +661,7 @@ meta_stack_tracker_record_remove (MetaStackTracker *tracker,
guint64 window,
gulong serial)
{
MetaStackOp *op = g_slice_new (MetaStackOp);
MetaStackOp *op = g_new0 (MetaStackOp, 1);
op->any.type = STACK_OP_REMOVE;
op->any.serial = serial;
@ -676,7 +676,7 @@ meta_stack_tracker_record_raise_above (MetaStackTracker *tracker,
guint64 sibling,
gulong serial)
{
MetaStackOp *op = g_slice_new (MetaStackOp);
MetaStackOp *op = g_new0 (MetaStackOp, 1);
op->any.type = STACK_OP_RAISE_ABOVE;
op->any.serial = serial;
@ -692,7 +692,7 @@ meta_stack_tracker_record_lower_below (MetaStackTracker *tracker,
guint64 sibling,
gulong serial)
{
MetaStackOp *op = g_slice_new (MetaStackOp);
MetaStackOp *op = g_new0 (MetaStackOp, 1);
op->any.type = STACK_OP_LOWER_BELOW;
op->any.serial = serial;

View file

@ -385,7 +385,7 @@ data_device_end_drag_grab (MetaWaylandDragGrab *drag_grab)
meta_display_sync_wayland_input_focus (meta_get_display ());
}
g_slice_free (MetaWaylandDragGrab, drag_grab);
g_free (drag_grab);
}
static gboolean
@ -583,7 +583,7 @@ meta_wayland_data_device_start_drag (MetaWaylandDataDevice *data
ClutterModifierType modifiers;
MetaSurfaceActor *surface_actor;
data_device->current_grab = drag_grab = g_slice_new0 (MetaWaylandDragGrab);
data_device->current_grab = drag_grab = g_new0 (MetaWaylandDragGrab, 1);
drag_grab->generic.interface = funcs;
drag_grab->generic.pointer = seat->pointer;

View file

@ -118,7 +118,7 @@ destroy_primary_offer (struct wl_resource *resource)
}
meta_display_sync_wayland_input_focus (meta_get_display ());
g_slice_free (MetaWaylandDataOffer, offer);
g_free (offer);
}
MetaWaylandDataOffer *
@ -126,7 +126,7 @@ meta_wayland_data_offer_primary_legacy_new (struct wl_resource *target)
{
MetaWaylandDataOffer *offer;
offer = g_slice_new0 (MetaWaylandDataOffer);
offer = g_new0 (MetaWaylandDataOffer, 1);
offer->selection_type = META_SELECTION_PRIMARY;
offer->resource = wl_resource_create (wl_resource_get_client (target),
&gtk_primary_selection_offer_interface,

View file

@ -118,7 +118,7 @@ destroy_primary_offer (struct wl_resource *resource)
}
meta_display_sync_wayland_input_focus (meta_get_display ());
g_slice_free (MetaWaylandDataOffer, offer);
g_free (offer);
}
MetaWaylandDataOffer *
@ -126,7 +126,7 @@ meta_wayland_data_offer_primary_new (struct wl_resource *target)
{
MetaWaylandDataOffer *offer;
offer = g_slice_new0 (MetaWaylandDataOffer);
offer = g_new0 (MetaWaylandDataOffer, 1);
offer->selection_type = META_SELECTION_PRIMARY;
offer->resource = wl_resource_create (wl_resource_get_client (target),
&zwp_primary_selection_offer_v1_interface,

View file

@ -229,7 +229,7 @@ destroy_data_offer (struct wl_resource *resource)
}
meta_display_sync_wayland_input_focus (meta_get_display ());
g_slice_free (MetaWaylandDataOffer, offer);
g_free (offer);
}
MetaWaylandDataOffer *
@ -239,7 +239,7 @@ meta_wayland_data_offer_new (MetaSelectionType selection_type,
{
MetaWaylandDataOffer *offer;
offer = g_slice_new0 (MetaWaylandDataOffer);
offer = g_new0 (MetaWaylandDataOffer, 1);
offer->selection_type = selection_type;
offer->resource = wl_resource_create (wl_resource_get_client (target),
&wl_data_offer_interface,

View file

@ -99,7 +99,7 @@ meta_wayland_pointer_client_new (void)
{
MetaWaylandPointerClient *pointer_client;
pointer_client = g_slice_new0 (MetaWaylandPointerClient);
pointer_client = g_new0 (MetaWaylandPointerClient, 1);
wl_list_init (&pointer_client->pointer_resources);
wl_list_init (&pointer_client->swipe_gesture_resources);
wl_list_init (&pointer_client->pinch_gesture_resources);
@ -138,7 +138,7 @@ meta_wayland_pointer_client_free (MetaWaylandPointerClient *pointer_client)
wl_list_init (wl_resource_get_link (resource));
}
g_slice_free (MetaWaylandPointerClient, pointer_client);
g_free (pointer_client);
}
static gboolean

View file

@ -167,7 +167,7 @@ meta_wayland_popup_grab_create (MetaWaylandPointer *pointer,
struct wl_client *client = wl_resource_get_client (surface->resource);
MetaWaylandPopupGrab *grab;
grab = g_slice_new0 (MetaWaylandPopupGrab);
grab = g_new0 (MetaWaylandPopupGrab, 1);
grab->generic.interface = &popup_grab_interface;
grab->generic.pointer = pointer;
grab->grab_client = client;
@ -182,7 +182,7 @@ void
meta_wayland_popup_grab_destroy (MetaWaylandPopupGrab *grab)
{
meta_wayland_popup_grab_end (grab);
g_slice_free (MetaWaylandPopupGrab, grab);
g_free (grab);
}
static void
@ -251,7 +251,7 @@ meta_wayland_popup_destroy (MetaWaylandPopup *popup)
meta_wayland_popup_surface_dismiss (popup->popup_surface);
wl_list_remove (&popup->link);
g_slice_free (MetaWaylandPopup, popup);
g_free (popup);
}
void
@ -297,7 +297,7 @@ meta_wayland_popup_create (MetaWaylandPopupSurface *popup_surface,
if (grab->grab_client != wl_resource_get_client (surface->resource))
return NULL;
popup = g_slice_new0 (MetaWaylandPopup);
popup = g_new0 (MetaWaylandPopup, 1);
popup->grab = grab;
popup->popup_surface = popup_surface;

View file

@ -79,7 +79,7 @@ wl_region_destructor (struct wl_resource *resource)
MetaWaylandRegion *region = wl_resource_get_user_data (resource);
cairo_region_destroy (region->region);
g_slice_free (MetaWaylandRegion, region);
g_free (region);
}
MetaWaylandRegion *
@ -88,7 +88,7 @@ meta_wayland_region_create (MetaWaylandCompositor *compositor,
struct wl_resource *compositor_resource,
guint32 id)
{
MetaWaylandRegion *region = g_slice_new0 (MetaWaylandRegion);
MetaWaylandRegion *region = g_new0 (MetaWaylandRegion, 1);
region->resource = wl_resource_create (client, &wl_region_interface, wl_resource_get_version (compositor_resource), id);
wl_resource_set_implementation (region->resource, &meta_wayland_wl_region_interface, region, wl_region_destructor);

View file

@ -161,7 +161,7 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
if (!op->sibling)
{
g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
g_free (op);
continue;
}
@ -188,7 +188,7 @@ meta_wayland_subsurface_parent_state_applied (MetaWaylandSubsurface *subsurface)
}
wl_list_remove (&op->sibling_destroy_listener.link);
g_slice_free (MetaWaylandSubsurfacePlacementOp, op);
g_free (op);
}
g_slist_free (surface->sub.pending_placement_ops);
@ -434,7 +434,7 @@ queue_subsurface_placement (MetaWaylandSurface *surface,
MetaWaylandSubsurfacePlacement placement)
{
MetaWaylandSubsurfacePlacementOp *op =
g_slice_new (MetaWaylandSubsurfacePlacementOp);
g_new0 (MetaWaylandSubsurfacePlacementOp, 1);
op->placement = placement;
op->sibling = sibling;

View file

@ -957,7 +957,7 @@ destroy_frame_callback (struct wl_resource *callback_resource)
wl_resource_get_user_data (callback_resource);
wl_list_remove (&callback->link);
g_slice_free (MetaWaylandFrameCallback, callback);
g_free (callback);
}
static void
@ -973,7 +973,7 @@ wl_surface_frame (struct wl_client *client,
if (!surface)
return;
callback = g_slice_new0 (MetaWaylandFrameCallback);
callback = g_new0 (MetaWaylandFrameCallback, 1);
callback->surface = surface;
callback->resource = wl_resource_create (client,
&wl_callback_interface,

View file

@ -108,7 +108,7 @@ meta_wayland_tablet_manager_new (MetaWaylandCompositor *compositor)
{
MetaWaylandTabletManager *tablet_manager;
tablet_manager = g_slice_new0 (MetaWaylandTabletManager);
tablet_manager = g_new0 (MetaWaylandTabletManager, 1);
tablet_manager->compositor = compositor;
tablet_manager->wl_display = compositor->wayland_display;
tablet_manager->seats = g_hash_table_new_full (NULL, NULL, NULL,
@ -132,7 +132,7 @@ void
meta_wayland_tablet_manager_free (MetaWaylandTabletManager *tablet_manager)
{
g_hash_table_destroy (tablet_manager->seats);
g_slice_free (MetaWaylandTabletManager, tablet_manager);
g_free (tablet_manager);
}
static MetaWaylandTabletSeat *

View file

@ -45,7 +45,7 @@ meta_wayland_tablet_pad_group_new (MetaWaylandTabletPad *pad)
{
MetaWaylandTabletPadGroup *group;
group = g_slice_new0 (MetaWaylandTabletPadGroup);
group = g_new0 (MetaWaylandTabletPadGroup, 1);
wl_list_init (&group->resource_list);
wl_list_init (&group->focus_resource_list);
group->pad = pad;
@ -67,7 +67,7 @@ meta_wayland_tablet_pad_group_free (MetaWaylandTabletPadGroup *group)
g_list_free (group->rings);
g_list_free (group->strips);
g_slice_free (MetaWaylandTabletPadGroup, group);
g_free (group);
}
static void

View file

@ -46,7 +46,7 @@ meta_wayland_tablet_pad_ring_new (MetaWaylandTabletPad *pad)
{
MetaWaylandTabletPadRing *ring;
ring = g_slice_new0 (MetaWaylandTabletPadRing);
ring = g_new0 (MetaWaylandTabletPadRing, 1);
wl_list_init (&ring->resource_list);
wl_list_init (&ring->focus_resource_list);
ring->pad = pad;
@ -66,7 +66,7 @@ meta_wayland_tablet_pad_ring_free (MetaWaylandTabletPadRing *ring)
}
g_free (ring->feedback);
g_slice_free (MetaWaylandTabletPadRing, ring);
g_free (ring);
}
static void

View file

@ -46,7 +46,7 @@ meta_wayland_tablet_pad_strip_new (MetaWaylandTabletPad *pad)
{
MetaWaylandTabletPadStrip *strip;
strip = g_slice_new0 (MetaWaylandTabletPadStrip);
strip = g_new0 (MetaWaylandTabletPadStrip, 1);
wl_list_init (&strip->resource_list);
wl_list_init (&strip->focus_resource_list);
strip->pad = pad;
@ -66,7 +66,7 @@ meta_wayland_tablet_pad_strip_free (MetaWaylandTabletPadStrip *strip)
}
g_free (strip->feedback);
g_slice_free (MetaWaylandTabletPadStrip, strip);
g_free (strip);
}
static void

View file

@ -100,7 +100,7 @@ meta_wayland_tablet_pad_new (ClutterInputDevice *device,
MetaWaylandTabletPad *pad;
guint n_elems, i;
pad = g_slice_new0 (MetaWaylandTabletPad);
pad = g_new0 (MetaWaylandTabletPad, 1);
wl_list_init (&pad->resource_list);
wl_list_init (&pad->focus_resource_list);
pad->focus_surface_listener.notify = pad_handle_focus_surface_destroy;
@ -168,7 +168,7 @@ meta_wayland_tablet_pad_free (MetaWaylandTabletPad *pad)
g_hash_table_destroy (pad->feedback);
g_slice_free (MetaWaylandTabletPad, pad);
g_free (pad);
}
static MetaWaylandTabletPadGroup *

View file

@ -258,7 +258,7 @@ meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager,
MetaWaylandTabletSeat *tablet_seat;
GList *devices, *l;
tablet_seat = g_slice_new0 (MetaWaylandTabletSeat);
tablet_seat = g_new0 (MetaWaylandTabletSeat, 1);
tablet_seat->manager = manager;
tablet_seat->seat = seat;
tablet_seat->clutter_seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
@ -303,7 +303,7 @@ meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat)
g_hash_table_destroy (tablet_seat->tablets);
g_hash_table_destroy (tablet_seat->tools);
g_hash_table_destroy (tablet_seat->pads);
g_slice_free (MetaWaylandTabletSeat, tablet_seat);
g_free (tablet_seat);
}
struct wl_resource *

View file

@ -387,7 +387,7 @@ meta_wayland_tablet_tool_new (MetaWaylandTabletSeat *seat,
{
MetaWaylandTabletTool *tool;
tool = g_slice_new0 (MetaWaylandTabletTool);
tool = g_new0 (MetaWaylandTabletTool, 1);
tool->seat = seat;
tool->device = device;
tool->device_tool = device_tool;
@ -424,7 +424,7 @@ meta_wayland_tablet_tool_free (MetaWaylandTabletTool *tool)
g_clear_signal_handler (&tool->prepare_at_signal_id, tool->default_sprite);
g_object_unref (tool->default_sprite);
g_slice_free (MetaWaylandTabletTool, tool);
g_free (tool);
}
static void

View file

@ -45,7 +45,7 @@ meta_wayland_tablet_new (ClutterInputDevice *device,
{
MetaWaylandTablet *tablet;
tablet = g_slice_new0 (MetaWaylandTablet);
tablet = g_new0 (MetaWaylandTablet, 1);
wl_list_init (&tablet->resource_list);
tablet->device = device;
tablet->tablet_seat = tablet_seat;
@ -65,7 +65,7 @@ meta_wayland_tablet_free (MetaWaylandTablet *tablet)
wl_list_init (wl_resource_get_link (resource));
}
g_slice_free (MetaWaylandTablet, tablet);
g_free (tablet);
}
static void

View file

@ -952,7 +952,7 @@ meta_xwayland_init_dnd (Display *xdisplay)
g_assert (manager->dnd == NULL);
manager->dnd = dnd = g_slice_new0 (MetaXWaylandDnd);
manager->dnd = dnd = g_new0 (MetaXWaylandDnd, 1);
for (i = 0; i < N_DND_ATOMS; i++)
xdnd_atoms[i] = gdk_x11_get_xatom_by_name (atom_names[i]);
@ -987,6 +987,6 @@ meta_xwayland_shutdown_dnd (Display *xdisplay)
XDestroyWindow (xdisplay, dnd->dnd_window);
dnd->dnd_window = None;
g_slice_free (MetaXWaylandDnd, dnd);
g_free (dnd);
manager->dnd = NULL;
}