Commit 2b20f0eb authored by Nalin Dahyabhai's avatar Nalin Dahyabhai

clarify comments near one of the warning messages. unref the Pango

* src/iso2022.c: clarify comments near one of the warning messages.
* src/vtefc.c(_vte_fc_transcribe_from_pango_font_description): unref the Pango
	context, which was created for us.
* src/vtepango.c: keep track of the Pango context, and unref it when it is no
	longer needed.
parent d83bc30b
2003-05-20 nalin
* src/iso2022.c: clarify comments near one of the warning messages.
* src/vtefc.c(_vte_fc_transcribe_from_pango_font_description): unref
the Pango context, which was created for us.
* src/vtepango.c: keep track of the Pango context, and unref it when
it is no longer needed.
2003-05-20 nalin
* src/Makefile.am: try juggling the CFLAGS and LIBS order to let the
xft CFLAGS/LIBS take precedence over everything else (#113335).
......
......@@ -1543,7 +1543,7 @@ process_control(struct _vte_iso2022_state *state, guchar *ctl, gsize length,
#endif
break;
default:
/* See ECMA-35. */
/* Application signalled an "identified coding system" we haven't heard of. See ECMA-35 for gory details. */
g_warning(_("Unrecognized identified coding system."));
break;
}
......
......@@ -117,6 +117,8 @@ _vte_fc_transcribe_from_pango_font_description(FcPattern *pattern,
FcPatternAddInteger(pattern, FC_SLANT,
_vte_fc_slant_from_pango_style(style));
}
g_object_unref(G_OBJECT(context));
}
static void
......
......@@ -37,6 +37,7 @@ struct _vte_pango_data
GdkPixmap *pixmap;
gint pixmapw, pixmaph;
gint scrollx, scrolly;
PangoContext *ctx;
PangoFontDescription *font;
PangoLayout *layout;
GdkGC *gc;
......@@ -89,6 +90,10 @@ _vte_pango_destroy(struct _vte_draw *draw)
g_object_unref(G_OBJECT(data->layout));
data->layout = NULL;
}
if (PANGO_IS_CONTEXT(data->ctx)) {
g_object_unref(G_OBJECT(data->ctx));
data->ctx = NULL;
}
if (GDK_IS_GC(data->gc)) {
g_object_unref(G_OBJECT(data->gc));
data->gc = NULL;
......@@ -127,11 +132,15 @@ _vte_pango_start(struct _vte_draw *draw)
#else
ctx = gdk_pango_context_get();
#endif
if (PANGO_IS_CONTEXT(data->ctx)) {
g_object_unref(G_OBJECT(data->ctx));
}
data->ctx = ctx;
if (PANGO_IS_LAYOUT(data->layout)) {
g_object_unref(G_OBJECT(data->layout));
}
data->layout = pango_layout_new(ctx);
data->layout = pango_layout_new(data->ctx);
if (data->font) {
pango_layout_set_font_description(data->layout, data->font);
}
......@@ -151,15 +160,20 @@ _vte_pango_end(struct _vte_draw *draw)
struct _vte_pango_data *data;
data = (struct _vte_pango_data*) draw->impl_data;
if (GDK_IS_GC(data->gc)) {
g_object_unref(G_OBJECT(data->gc));
}
data->gc = NULL;
if (PANGO_IS_LAYOUT(data->layout)) {
g_object_unref(G_OBJECT(data->layout));
}
data->layout = NULL;
if (GDK_IS_GC(data->gc)) {
g_object_unref(G_OBJECT(data->gc));
if (PANGO_IS_CONTEXT(data->ctx)) {
g_object_unref(G_OBJECT(data->ctx));
}
data->gc = NULL;
data->ctx = NULL;
}
static void
......@@ -325,6 +339,7 @@ _vte_pango_set_text_font(struct _vte_draw *draw,
#endif
g_object_unref(G_OBJECT(layout));
g_object_unref(G_OBJECT(ctx));
}
static int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment