summaryrefslogtreecommitdiff
path: root/pango
diff options
context:
space:
mode:
authorElliot Lee <sopwith@src.gnome.org>2000-08-08 03:37:22 +0000
committerElliot Lee <sopwith@src.gnome.org>2000-08-08 03:37:22 +0000
commit0d0b47ba872c90fbad6312c77c12b7380f27ab6c (patch)
tree2f4cb763e26ec800e8590c94a780d87f9bf992e9 /pango
parent6651251110e502c5d328d6ad84876377adba481d (diff)
downloadpango-0d0b47ba872c90fbad6312c77c12b7380f27ab6c.tar.gz
If the first pango_skip_space fails, remember to free enginepair before
* pango/modules.c: If the first pango_skip_space fails, remember to free enginepair before continuing. * pango/pango-layout.c (pango_layout_set_attributes): unref old attr list after reffing new one, in case setting to same thing. * pango/pango-attributes.c (pango_attr_list_insert_internal): Proper fix from Owen for the infinite loop.
Diffstat (limited to 'pango')
-rw-r--r--pango/modules.c5
-rw-r--r--pango/pango-attributes.c4
-rw-r--r--pango/pango-layout.c7
3 files changed, 12 insertions, 4 deletions
diff --git a/pango/modules.c b/pango/modules.c
index d7d3b838..5d3f9cb9 100644
--- a/pango/modules.c
+++ b/pango/modules.c
@@ -217,7 +217,10 @@ process_module_file (FILE *module_file)
p = line_buf->str;
if (!pango_skip_space (&p))
- continue;
+ {
+ g_free (pair);
+ continue;
+ }
/* Break line into words on whitespace */
i = 0;
diff --git a/pango/pango-attributes.c b/pango/pango-attributes.c
index a081235d..d2349eac 100644
--- a/pango/pango-attributes.c
+++ b/pango/pango-attributes.c
@@ -740,7 +740,7 @@ pango_attr_list_insert_internal (PangoAttrList *list,
{
prev = NULL;
tmp_list = list->attributes;
- while (tmp_list)
+ while (1)
{
PangoAttribute *tmp_attr = tmp_list->data;
@@ -758,6 +758,8 @@ pango_attr_list_insert_internal (PangoAttrList *list,
if (!tmp_list)
list->attributes_tail = link;
+
+ break;
}
prev = tmp_list;
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 84acc12e..7025083f 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -333,14 +333,17 @@ void
pango_layout_set_attributes (PangoLayout *layout,
PangoAttrList *attrs)
{
+ PangoAttrList *old_attrs;
g_return_if_fail (layout != NULL);
- if (layout->attrs)
- pango_attr_list_unref (layout->attrs);
+ old_attrs = layout->attrs;
layout->attrs = attrs;
pango_attr_list_ref (layout->attrs);
pango_layout_clear_lines (layout);
+
+ if (old_attrs)
+ pango_attr_list_unref (layout->attrs);
}
/**