summaryrefslogtreecommitdiffstats
path: root/sesman/chansrv/clipboard.c
diff options
context:
space:
mode:
authorjsorg71 <jsorg71>2009-09-05 19:11:03 +0000
committerjsorg71 <jsorg71>2009-09-05 19:11:03 +0000
commit9a12982a694c235133b5a30d08e39bbfbaf77d9b (patch)
tree254d08d19a1c5d3d256d1058f1e9559379663753 /sesman/chansrv/clipboard.c
parent90ce47855c4b84195eeeaadd0aaa358441d745f4 (diff)
downloadxrdp-proprietary-9a12982a694c235133b5a30d08e39bbfbaf77d9b.tar.gz
xrdp-proprietary-9a12982a694c235133b5a30d08e39bbfbaf77d9b.zip
improvements for when a session is disconnected
Diffstat (limited to 'sesman/chansrv/clipboard.c')
-rw-r--r--sesman/chansrv/clipboard.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/sesman/chansrv/clipboard.c b/sesman/chansrv/clipboard.c
index f7d4ee3f..b6ac73fe 100644
--- a/sesman/chansrv/clipboard.c
+++ b/sesman/chansrv/clipboard.c
@@ -142,6 +142,7 @@ clipboard_init(void)
{
return 0;
}
+ clipboard_deinit();
rv = 0;
/* setting the error handlers can cause problem when shutting down
chansrv on some xlibs */
@@ -246,19 +247,27 @@ clipboard_init(void)
int APP_CC
clipboard_deinit(void)
{
- if (!g_clip_up)
+ if (g_x_wait_obj != 0)
{
- return 0;
+ g_delete_wait_obj_from_socket(g_x_wait_obj);
+ g_x_wait_obj = 0;
+ }
+ if (g_wnd != 0)
+ {
+ XDestroyWindow(g_display, g_wnd);
+ g_wnd = 0;
}
- g_delete_wait_obj_from_socket(g_x_wait_obj);
- g_x_wait_obj = 0;
- XDestroyWindow(g_display, g_wnd);
- g_wnd = 0;
g_x_socket = 0;
g_free(g_last_clip_data);
g_last_clip_data = 0;
g_last_clip_size = 0;
free_stream(g_ins);
+ g_ins = 0;
+ if (g_display != 0)
+ {
+ XCloseDisplay(g_display);
+ g_display = 0;
+ }
g_clip_up = 0;
return 0;
}