diff options
author | Matthias Clasen <mclasen@redhat.com> | 2006-07-20 18:42:17 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-07-20 18:42:17 +0000 |
commit | 4e7097ff0837ce4d57c07cb0fb5faae5cd64a46d (patch) | |
tree | deb82ad8d6b2d4a2a45a1fa1910e64f4e99a00d8 /gtk | |
parent | 7014a3b5bb9a630661a66d440ca43a7ca7bba2d8 (diff) | |
download | gtk+-4e7097ff0837ce4d57c07cb0fb5faae5cd64a46d.tar.gz |
Fix messed up refcounting. (#348090, Chris Wilson)
2006-07-20 Matthias Clasen <mclasen@redhat.com>
* gtk/gtktextlayout.c (gtk_text_layout_set_contexts): Fix
messed up refcounting. (#348090, Chris Wilson)
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtktextlayout.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index 42c3b83ee0..5f62e70304 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -369,17 +369,23 @@ gtk_text_layout_set_contexts (GtkTextLayout *layout, { g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout)); - if (layout->ltr_context) - g_object_unref (ltr_context); + if (layout->ltr_context != ltr_context) + { + if (layout->ltr_context) + g_object_unref (layout->ltr_context); - layout->ltr_context = ltr_context; - g_object_ref (ltr_context); + layout->ltr_context = ltr_context; + g_object_ref (layout->ltr_context); + } - if (layout->rtl_context) - g_object_unref (rtl_context); + if (layout->rtl_context != rtl_context) + { + if (layout->rtl_context) + g_object_unref (layout->rtl_context); - layout->rtl_context = rtl_context; - g_object_ref (rtl_context); + layout->rtl_context = rtl_context; + g_object_ref (layout->rtl_context); + } DV (g_print ("invalidating all due to new pango contexts (%s)\n", G_STRLOC)); gtk_text_layout_invalidate_all (layout); |