-static void
-gtk_text_layout_finalize (GObject *object)
-{
- GtkTextLayout *layout;
-
- layout = GTK_TEXT_LAYOUT (object);
-
- gtk_text_layout_set_buffer (layout, NULL);
-
- if (layout->default_style)
- gtk_text_attributes_unref (layout->default_style);
- layout->default_style = NULL;
-
- if (layout->ltr_context)
- {
- g_object_unref (layout->ltr_context);
- layout->ltr_context = NULL;
- }
- if (layout->rtl_context)
- {
- g_object_unref (layout->rtl_context);
- layout->rtl_context = NULL;
- }
-
- if (layout->one_display_cache)
- {
- GtkTextLineDisplay *tmp_display = layout->one_display_cache;
- layout->one_display_cache = NULL;
- gtk_text_layout_free_line_display (layout, tmp_display);
- }
-
- if (layout->preedit_string)
- {
- g_free (layout->preedit_string);
- layout->preedit_string = NULL;
- }
-
- if (layout->preedit_attrs)
- {
- pango_attr_list_unref (layout->preedit_attrs);
- layout->preedit_attrs = NULL;
- }
-
-
- G_OBJECT_CLASS (gtk_text_layout_parent_class)->finalize (object);
-}
-