From fc16c6f7bdeb1f4bd238005d43cb7d5b7e4c3707 Mon Sep 17 00:00:00 2001 From: Vic Lee Date: Sat, 13 Aug 2011 11:46:00 +0800 Subject: [PATCH] xfreerdp: fix exit segfault. --- client/X11/xfreerdp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 067168949..03a13ebe6 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -403,9 +403,10 @@ void xf_free(xfInfo* xfi) { xf_window_free(xfi); XCloseDisplay(xfi->display); + xfree(xfi); } -int dfreerdp_run(freerdp* instance) +int xfreerdp_run(freerdp* instance) { int i; int fds; @@ -422,11 +423,11 @@ int dfreerdp_run(freerdp* instance) memset(rfds, 0, sizeof(rfds)); memset(wfds, 0, sizeof(wfds)); + instance->Connect(instance); + xfi = GET_XFI(instance); chanman = GET_CHANMAN(instance); - instance->Connect(instance); - while (1) { rcount = 0; @@ -508,7 +509,7 @@ void* thread_func(void* param) struct thread_data* data; data = (struct thread_data*) param; - dfreerdp_run(data->instance); + xfreerdp_run(data->instance); xfree(data); @@ -517,7 +518,7 @@ void* thread_func(void* param) g_thread_count--; if (g_thread_count < 1) - freerdp_sem_signal(&g_sem); + freerdp_sem_signal(g_sem); return NULL; }