x11: Stop using g_slice
authorMatthias Clasen <mclasen@redhat.com>
Fri, 3 Mar 2023 11:28:46 +0000 (06:28 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 14 Mar 2023 18:56:42 +0000 (14:56 -0400)
gdk/x11/gdkdisplay-x11.c
gdk/x11/gdkdrag-x11.c
gdk/x11/gdkselectionoutputstream-x11.c
gdk/x11/gdksurface-x11.c

index 0e30ff23b5306c9b5f4ae8861a244d98fefc2510..a1b1fef9eeaacf5ba57fd187094a39935b766680 100644 (file)
@@ -1975,7 +1975,7 @@ gdk_x11_display_finalize (GObject *object)
       if (trap->end_sequence == 0)
         g_warning ("Display finalized with an unpopped error trap");
 
-      g_slice_free (GdkErrorTrap, trap);
+      g_free (trap);
     }
 
   g_free (display_x11->program_class);
@@ -2499,7 +2499,7 @@ delete_outdated_error_traps (GdkX11Display *display_x11)
           tmp_list = tmp_list->next;
           display_x11->error_traps =
             g_slist_delete_link (display_x11->error_traps, free_me);
-          g_slice_free (GdkErrorTrap, trap);
+          g_free (trap);
         }
       else
         {
@@ -2531,7 +2531,7 @@ gdk_x11_display_error_trap_push (GdkDisplay *display)
   /* set up the Xlib callback to tell us about errors */
   _gdk_x11_error_handler_push ();
 
-  trap = g_slice_new0 (GdkErrorTrap);
+  trap = g_new0 (GdkErrorTrap, 1);
 
   trap->start_sequence = XNextRequest (display_x11->xdisplay);
   trap->error_code = Success;
index 49e23787d98d2d228a87c7ba4f63662de5012068..df6ff98d30cf9a7d44760924940d389b27c1e54d 100644 (file)
@@ -1783,7 +1783,7 @@ gdk_drag_anim_destroy (GdkDragAnim *anim)
 {
   gdk_surface_hide (anim->drag->drag_surface);
   g_object_unref (anim->drag);
-  g_slice_free (GdkDragAnim, anim);
+  g_free (anim);
 }
 
 static gboolean
@@ -1882,7 +1882,7 @@ gdk_x11_drag_drop_done (GdkDrag  *drag,
   cairo_surface_destroy (surface);
 */
 
-  anim = g_slice_new0 (GdkDragAnim);
+  anim = g_new0 (GdkDragAnim, 1);
   anim->drag = g_object_ref (x11_drag);
   anim->frame_clock = gdk_surface_get_frame_clock (x11_drag->drag_surface);
   anim->start_time = gdk_frame_clock_get_frame_time (anim->frame_clock);
index 76815bee65ccae6366370508dcb19a7eff4b5dd5..3175be5e07e030b0d2e5661f80223738c28c6f7e 100644 (file)
@@ -79,7 +79,7 @@ gdk_x11_pending_selection_notify_new (Window window,
 {
   GdkX11PendingSelectionNotify *pending;
 
-  pending = g_slice_new0 (GdkX11PendingSelectionNotify);
+  pending = g_new0 (GdkX11PendingSelectionNotify, 1);
   pending->n_pending = 1;
 
   pending->xevent.type = SelectionNotify;
@@ -97,7 +97,7 @@ gdk_x11_pending_selection_notify_new (Window window,
 static void
 gdk_x11_pending_selection_notify_free (GdkX11PendingSelectionNotify *notify)
 {
-  g_slice_free (GdkX11PendingSelectionNotify, notify);
+  g_free (notify);
 }
 
 static void
@@ -731,7 +731,7 @@ handle_timestamp_done (GObject      *stream,
       g_error_free (error);
     }
 
-  g_slice_free (gulong, user_data);
+  g_free (user_data);
 }
 
 static void
@@ -747,7 +747,7 @@ handle_timestamp (GOutputStream                *stream,
 {
   gulong *time_;
 
-  time_ = g_slice_new (gulong);
+  time_ = g_new (gulong, 1);
   *time_ = timestamp;
 
   g_output_stream_write_all_async (stream,
index a76e4824f2ed1c0e2c1f002257c3fcbda60c9f16..044a1185fa4553f89f7fd3c8dfb7da7c86863ee6 100644 (file)
@@ -787,7 +787,7 @@ free_pixmap (gpointer datap)
     }
 
   g_object_unref (data->display);
-  g_slice_free (FreePixmapData, data);
+  g_free (data);
 }
 
 static void
@@ -798,7 +798,7 @@ attach_free_pixmap_handler (cairo_surface_t *surface,
   static const cairo_user_data_key_t key;
   FreePixmapData *data;
   
-  data = g_slice_new (FreePixmapData);
+  data = g_new (FreePixmapData, 1);
   data->display = g_object_ref (display);
   data->pixmap = pixmap;