[pango/pango2: 37/68] Add autoptr cleanup




commit 443e4c249c19965f73bf339f8d57cfb1b02da012
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 11 16:23:47 2022 -0400

    Add autoptr cleanup
    
    Add autoptr cleanup declarations for many types
    that were missing it.

 pango/pango-color.h        | 1 +
 pango/pango-font-metrics.h | 1 +
 pango/pango-glyph-item.h   | 2 ++
 pango/pango-glyph-iter.h   | 2 ++
 pango/pango-glyph.h        | 3 +++
 pango/pango-item.h         | 2 ++
 pango/pango-line-iter.h    | 2 ++
 pango/pango-line.h         | 2 ++
 pango/pango-matrix.h       | 2 ++
 pango/pango-script.h       | 8 +++++---
 10 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/pango/pango-color.h b/pango/pango-color.h
index 17e494dc9..f184d4b6a 100644
--- a/pango/pango-color.h
+++ b/pango/pango-color.h
@@ -66,5 +66,6 @@ gboolean    pango_color_parse_with_alpha (PangoColor       *color,
 PANGO_AVAILABLE_IN_ALL
 char       *pango_color_to_string        (const PangoColor *color);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoColor, pango_color_free)
 
 G_END_DECLS
diff --git a/pango/pango-font-metrics.h b/pango/pango-font-metrics.h
index 7f5a518c3..d046f2d1a 100644
--- a/pango/pango-font-metrics.h
+++ b/pango/pango-font-metrics.h
@@ -73,5 +73,6 @@ int               pango_font_metrics_get_strikethrough_position  (PangoFontMetri
 PANGO_AVAILABLE_IN_ALL
 int               pango_font_metrics_get_strikethrough_thickness (PangoFontMetrics *metrics) G_GNUC_PURE;
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoFontMetrics, pango_font_metrics_unref)
 
 G_END_DECLS
diff --git a/pango/pango-glyph-item.h b/pango/pango-glyph-item.h
index 85902e3a7..82e5dca4a 100644
--- a/pango/pango-glyph-item.h
+++ b/pango/pango-glyph-item.h
@@ -82,5 +82,7 @@ void                    pango_glyph_item_get_logical_widths     (PangoGlyphItem
                                                                  const char     *text,
                                                                  int            *logical_widths);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoGlyphItem, pango_glyph_item_free)
+
 
 G_END_DECLS
diff --git a/pango/pango-glyph-iter.h b/pango/pango-glyph-iter.h
index 870422679..3c328cc72 100644
--- a/pango/pango-glyph-iter.h
+++ b/pango/pango-glyph-iter.h
@@ -105,4 +105,6 @@ gboolean                pango_glyph_item_iter_next_cluster (PangoGlyphItemIter *
 PANGO_AVAILABLE_IN_ALL
 gboolean                pango_glyph_item_iter_prev_cluster (PangoGlyphItemIter *iter);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoGlyphItemIter, pango_glyph_item_iter_free)
+
 G_END_DECLS
diff --git a/pango/pango-glyph.h b/pango/pango-glyph.h
index 0507b6135..94938b84c 100644
--- a/pango/pango-glyph.h
+++ b/pango/pango-glyph.h
@@ -210,6 +210,9 @@ void                    pango_glyph_string_index_to_x_full      (PangoGlyphStrin
                                                                  gboolean             trailing,
                                                                  int                 *x_pos);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoGlyphString, pango_glyph_string_free)
+
+
 /* Shaping */
 
 /**
diff --git a/pango/pango-item.h b/pango/pango-item.h
index 7e58aab6a..5b6c9e97f 100644
--- a/pango/pango-item.h
+++ b/pango/pango-item.h
@@ -110,4 +110,6 @@ int                     pango_item_get_char_offset              (PangoItem *item
 PANGO_AVAILABLE_IN_ALL
 int                     pango_item_get_char_length              (PangoItem *item);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoItem, pango_item_free)
+
 G_END_DECLS
diff --git a/pango/pango-line-iter.h b/pango/pango-line-iter.h
index 84c3c8560..33efeacfc 100644
--- a/pango/pango-line-iter.h
+++ b/pango/pango-line-iter.h
@@ -98,4 +98,6 @@ int                  pango_line_iter_get_line_baseline        (PangoLineIter
 PANGO_AVAILABLE_IN_ALL
 int                  pango_line_iter_get_run_baseline         (PangoLineIter    *iter);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoLineIter, pango_line_iter_free)
+
 G_END_DECLS
diff --git a/pango/pango-line.h b/pango/pango-line.h
index ae2d45a30..2a0562b92 100644
--- a/pango/pango-line.h
+++ b/pango/pango-line.h
@@ -121,4 +121,6 @@ void                 pango_line_get_caret_pos          (PangoLine        *line,
                                                         PangoRectangle   *strong_pos,
                                                         PangoRectangle   *weak_pos);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoLine, pango_line_free)
+
 G_END_DECLS
diff --git a/pango/pango-matrix.h b/pango/pango-matrix.h
index 9662d6a1d..ccacb2ab5 100644
--- a/pango/pango-matrix.h
+++ b/pango/pango-matrix.h
@@ -123,5 +123,7 @@ double pango_matrix_get_rotation (const PangoMatrix *matrix) G_GNUC_PURE;
 PANGO_AVAILABLE_IN_ALL
 double pango_matrix_get_slant_ratio (const PangoMatrix *matrix) G_GNUC_PURE;
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoMatrix, pango_matrix_free)
+
 
 G_END_DECLS
diff --git a/pango/pango-script.h b/pango/pango-script.h
index cabcc9026..0ceeda228 100644
--- a/pango/pango-script.h
+++ b/pango/pango-script.h
@@ -21,6 +21,7 @@
 
 #include <glib-object.h>
 
+#include <pango/pango-language.h>
 #include <pango/pango-version-macros.h>
 
 G_BEGIN_DECLS
@@ -49,9 +50,10 @@ gboolean         pango_script_iter_next      (PangoScriptIter     *iter);
 PANGO_AVAILABLE_IN_ALL
 void             pango_script_iter_free      (PangoScriptIter     *iter);
 
-#include <pango/pango-language.h>
-
 PANGO_AVAILABLE_IN_ALL
-PangoLanguage *pango_script_get_sample_language (GUnicodeScript    script) G_GNUC_PURE;
+PangoLanguage   *pango_script_get_sample_language
+                                             (GUnicodeScript       script) G_GNUC_PURE;
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(PangoScriptIter, pango_script_iter_free)
 
 G_END_DECLS


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