From 53e29768677204cca7eeb012aa70740b14e1162b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gr=C3=A9goire=20Jadi?= Date: Tue, 16 Jul 2013 19:39:19 +0200 Subject: [PATCH] * src/xwidget.c (kill_buffer_xwidgets): Cleanup OSR GtkWidget when xwidget are freed. --- src/xwidget.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/xwidget.c b/src/xwidget.c index fcebc85bba1..7834e5b0bea 100644 --- a/src/xwidget.c +++ b/src/xwidget.c @@ -1883,12 +1883,21 @@ xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) void kill_buffer_xwidgets (Lisp_Object buffer) { - Lisp_Object tail, xw; + Lisp_Object tail, xwidget; for (tail = Fget_buffer_xwidgets (buffer); CONSP (tail); tail = XCDR (tail)) { - xw = XCAR (tail); - Vxwidget_list = Fdelq (xw, Vxwidget_list); + xwidget = XCAR (tail); + Vxwidget_list = Fdelq (xwidget, Vxwidget_list); /* TODO free the GTK things in xw */ + { + CHECK_XWIDGET (xwidget); + struct xwidget *xw = XXWIDGET (xwidget); + if (xw->widget_osr && xw->widgetwindow_osr) + { + gtk_widget_destroy(GTK_WIDGET (xw->widget_osr)); + gtk_widget_destroy(GTK_WIDGET (xw->widgetwindow_osr)); + } + } } } -- 2.39.2