From 899e56c108c316c8a78b80df873146a1ec799944 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Mon, 19 Jan 2004 23:45:26 +0000 Subject: [PATCH] fix g_gc memleak git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/trunk/rdesktop@565 423420c4-83ab-492f-b58f-81f9feb106b5 --- xwin.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xwin.c b/xwin.c index 13e0c9e..ba4c25d 100644 --- a/xwin.c +++ b/xwin.c @@ -43,6 +43,7 @@ static Screen *g_screen; Window g_wnd; BOOL g_enable_compose = False; static GC g_gc; +static BOOL g_gc_initialized = False; static Visual *g_visual; static int g_depth; static int g_bpp; @@ -887,7 +888,11 @@ ui_create_window(void) CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap | CWBorderPixel, &attribs); - g_gc = XCreateGC(g_display, g_wnd, 0, NULL); + if ( ! g_gc_initialized ) + { + g_gc = XCreateGC(g_display, g_wnd, 0, NULL); + g_gc_initialized = True; + } if ((g_ownbackstore) && (! g_backstore_initialized)) {