summaryrefslogtreecommitdiff
path: root/src/widget.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-08-02 17:22:23 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-08-02 17:22:23 +0400
commit4b5c9326ce8f6b7856437cbbdbcccb415b38a5fc (patch)
tree797f94ac354fa4eaa7d3b8dc43590fa7824ddf0d /src/widget.c
parent26bb8a7ceb23a748e35afbc895b54e8c1322298f (diff)
downloademacs-4b5c9326ce8f6b7856437cbbdbcccb415b38a5fc.tar.gz
Fix X GC leak in GTK and raw (no toolkit) X ports.
* xterm.c (x_free_frame_resources): If white and black relief GCs are allocated, always free them here. * xfns.c (x_make_gc): Omit redundant initialization. * widget.c (create_frame_gcs): Remove the leftover. (EmacsFrameDestroy): Do nothing because all GCs are now freed in x_free_frame_resources.
Diffstat (limited to 'src/widget.c')
-rw-r--r--src/widget.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/widget.c b/src/widget.c
index e2c8e9fa23f..f66ec0b80ec 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -503,26 +503,6 @@ widget_update_wm_size_hints (Widget widget)
update_wm_hints (ew);
}
-
-#if 0
-
-static void
-create_frame_gcs (EmacsFrame ew)
-{
- struct frame *s = ew->emacs_frame.frame;
-
- s->output_data.x->normal_gc
- = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
- s->output_data.x->reverse_gc
- = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
- s->output_data.x->cursor_gc
- = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0);
- s->output_data.x->black_relief.gc = 0;
- s->output_data.x->white_relief.gc = 0;
-}
-
-#endif /* 0 */
-
static char setup_frame_cursor_bits[] =
{
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -683,19 +663,7 @@ EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs
static void
EmacsFrameDestroy (Widget widget)
{
- EmacsFrame ew = (EmacsFrame) widget;
- struct frame* s = ew->emacs_frame.frame;
-
- if (! s) emacs_abort ();
- if (! s->output_data.x) emacs_abort ();
-
- block_input ();
- x_free_gcs (s);
- if (s->output_data.x->white_relief.gc)
- XFreeGC (XtDisplay (widget), s->output_data.x->white_relief.gc);
- if (s->output_data.x->black_relief.gc)
- XFreeGC (XtDisplay (widget), s->output_data.x->black_relief.gc);
- unblock_input ();
+ /* All GCs are now freed in x_free_frame_resources. */
}
static void