aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Atoms.c15
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Atoms.h2
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c2
3 files changed, 17 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
index eecead6e1..2e144bb0c 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c
@@ -364,7 +364,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
typedef struct {
Atom local;
XlibAtom remote;
- const char *string;
+ char *string;
int length;
} AtomMap;
@@ -397,7 +397,7 @@ static void nxagentExpandCache(void)
static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string)
{
- const char *s = strdup(string);
+ char *s = strdup(string);
#ifdef WARNING
if (s == NULL)
@@ -436,6 +436,17 @@ void nxagentResetAtomMap(void)
nxagentPrintAtomMapInfo("nxagentResetAtomMap: Exiting");
}
+void nxagentFreeAtomMap(void)
+{
+ for (unsigned int i = 0; i < privLastAtom; i++)
+ {
+ SAFE_free(privAtomMap[i].string);
+ }
+
+ SAFE_free(privAtomMap);
+ privLastAtom = privAtomMapSize = 0;
+}
+
/*
* Init map.
* Initializing the atomNameList all in one.
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h
index 8dff0d5a7..a39c53c07 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h
+++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h
@@ -51,6 +51,8 @@ int nxagentQueryAtoms(ScreenPtr pScreen);
void nxagentResetAtomMap(void);
+void nxagentFreeAtomMap(void);
+
void nxagentWMDetect(void);
#ifdef XlibAtom
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
index ad9ce771f..ede0ffdcc 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c
@@ -580,6 +580,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
NXShadowDestroy();
}
saveAgentState("TERMINATED");
+
+ nxagentFreeAtomMap();
#endif /* NXAGENT_SERVER */
KillAllClients();