summaryrefslogtreecommitdiffstats
path: root/xup
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-01-28 10:40:19 -0800
committerJay Sorg <jay.sorg@gmail.com>2014-01-28 10:40:19 -0800
commit022c1e31f9f9cee15d7264fb0f520c1a795b73ef (patch)
treefc79eaf47029b9808ef92e394ae4b427aae4351d /xup
parent48228cae2eaa0847b07f899811dd7f0ab8a7365e (diff)
downloadxrdp-proprietary-022c1e31f9f9cee15d7264fb0f520c1a795b73ef.tar.gz
xrdp-proprietary-022c1e31f9f9cee15d7264fb0f520c1a795b73ef.zip
xup: call shmdt on disconnect
Diffstat (limited to 'xup')
-rw-r--r--xup/xup.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xup/xup.c b/xup/xup.c
index 7ff5e5e8..d3079b91 100644
--- a/xup/xup.c
+++ b/xup/xup.c
@@ -21,9 +21,6 @@
#include "xup.h"
#include "log.h"
-#include <sys/ipc.h>
-#include <sys/shm.h>
-
#define LOG_LEVEL 1
#define LLOG(_level, _args) \
do { if (_level < LOG_LEVEL) { g_write _args ; } } while (0)
@@ -527,7 +524,7 @@ process_server_window_show(struct mod* mod, struct stream* s)
int rv;
int flags;
struct rail_window_state_order rwso;
-
+
g_memset(&rwso, 0, sizeof(rwso));
in_uint32_le(s, window_id);
in_uint32_le(s, flags);
@@ -899,7 +896,7 @@ lib_mod_process_orders(struct mod *mod, int type, struct stream *s)
if (mod->screen_shmem_id == 0)
{
mod->screen_shmem_id = shmem_id;
- mod->screen_shmem_pixels = shmat(mod->screen_shmem_id, 0, 0);
+ mod->screen_shmem_pixels = g_shmat(mod->screen_shmem_id);
}
if (mod->screen_shmem_pixels != 0)
{
@@ -1062,6 +1059,11 @@ lib_mod_signal(struct mod *mod)
int DEFAULT_CC
lib_mod_end(struct mod *mod)
{
+ if (mod->screen_shmem_pixels != 0)
+ {
+ g_shmdt(mod->screen_shmem_pixels);
+ mod->screen_shmem_pixels = 0;
+ }
return 0;
}