From: Grégoire Jadi Date: Tue, 16 Jul 2013 17:39:19 +0000 (+0200) Subject: * src/xwidget.c (kill_buffer_xwidgets): Cleanup OSR GtkWidget when xwidget X-Git-Tag: emacs-25.0.90~2886 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=53e29768677204cca7eeb012aa70740b14e1162b;p=emacs.git * src/xwidget.c (kill_buffer_xwidgets): Cleanup OSR GtkWidget when xwidget are freed. --- 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)); + } + } } }