[mutter] theme: Remove unused memory management functions



commit 644ab0e27081025e0386e82e72cda007f197ef87
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Feb 11 17:49:21 2015 -0800

    theme: Remove unused memory management functions

 src/ui/theme-private.h |    6 +-----
 src/ui/theme.c         |   38 ++++----------------------------------
 2 files changed, 5 insertions(+), 39 deletions(-)
---
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index 0f2a83e..f012d10 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -53,8 +53,6 @@ typedef struct _MetaFrameGeometry MetaFrameGeometry;
  **/
 struct _MetaFrameLayout
 {
-  int refcount;
-
   /** Border/padding of the entire frame */
   GtkBorder frame_border;
   /** Border/padding of the titlebar region */
@@ -229,9 +227,7 @@ struct _MetaTheme
 };
 
 MetaFrameLayout* meta_frame_layout_new           (void);
-MetaFrameLayout* meta_frame_layout_copy          (const MetaFrameLayout *src);
-void             meta_frame_layout_ref           (MetaFrameLayout       *layout);
-void             meta_frame_layout_unref         (MetaFrameLayout       *layout);
+void             meta_frame_layout_free          (MetaFrameLayout       *layout);
 void             meta_frame_layout_get_borders   (const MetaFrameLayout *layout,
                                                   int                    text_height,
                                                   MetaFrameFlags         flags,
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 9ecbeda..be35b04 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -45,8 +45,6 @@ meta_frame_layout_new  (void)
 
   layout = g_new0 (MetaFrameLayout, 1);
 
-  layout->refcount = 1;
-
   /* Spacing as hardcoded in GTK+:
    * https://git.gnome.org/browse/gtk+/tree/gtk/gtkheaderbar.c?h=gtk-3-14#n53
    */
@@ -58,41 +56,13 @@ meta_frame_layout_new  (void)
   return layout;
 }
 
-MetaFrameLayout*
-meta_frame_layout_copy (const MetaFrameLayout *src)
-{
-  MetaFrameLayout *layout;
-
-  layout = g_new0 (MetaFrameLayout, 1);
-
-  *layout = *src;
-
-  layout->refcount = 1;
-
-  return layout;
-}
-
-void
-meta_frame_layout_ref (MetaFrameLayout *layout)
-{
-  g_return_if_fail (layout != NULL);
-
-  layout->refcount += 1;
-}
-
 void
-meta_frame_layout_unref (MetaFrameLayout *layout)
+meta_frame_layout_free (MetaFrameLayout *layout)
 {
   g_return_if_fail (layout != NULL);
-  g_return_if_fail (layout->refcount > 0);
-
-  layout->refcount -= 1;
 
-  if (layout->refcount == 0)
-    {
-      DEBUG_FILL_STRUCT (layout);
-      g_free (layout);
-    }
+  DEBUG_FILL_STRUCT (layout);
+  g_free (layout);
 }
 
 void
@@ -928,7 +898,7 @@ meta_theme_free (MetaTheme *theme)
 
   for (i = 0; i < META_FRAME_TYPE_LAST; i++)
     if (theme->layouts[i])
-      meta_frame_layout_unref (theme->layouts[i]);
+      meta_frame_layout_free (theme->layouts[i]);
 
   DEBUG_FILL_STRUCT (theme);
   g_free (theme);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]