Commit 66eea14c authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: Free atom map on termination

parent 18439f55
...@@ -364,7 +364,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen) ...@@ -364,7 +364,7 @@ int nxagentQueryAtoms(ScreenPtr pScreen)
typedef struct { typedef struct {
Atom local; Atom local;
XlibAtom remote; XlibAtom remote;
const char *string; char *string;
int length; int length;
} AtomMap; } AtomMap;
...@@ -397,7 +397,7 @@ static void nxagentExpandCache(void) ...@@ -397,7 +397,7 @@ static void nxagentExpandCache(void)
static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string) static void nxagentWriteAtom(Atom local, XlibAtom remote, const char *string)
{ {
const char *s = strdup(string); char *s = strdup(string);
#ifdef WARNING #ifdef WARNING
if (s == NULL) if (s == NULL)
...@@ -436,6 +436,17 @@ void nxagentResetAtomMap(void) ...@@ -436,6 +436,17 @@ void nxagentResetAtomMap(void)
nxagentPrintAtomMapInfo("nxagentResetAtomMap: Exiting"); 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. * Init map.
* Initializing the atomNameList all in one. * Initializing the atomNameList all in one.
......
...@@ -51,6 +51,8 @@ int nxagentQueryAtoms(ScreenPtr pScreen); ...@@ -51,6 +51,8 @@ int nxagentQueryAtoms(ScreenPtr pScreen);
void nxagentResetAtomMap(void); void nxagentResetAtomMap(void);
void nxagentFreeAtomMap(void);
void nxagentWMDetect(void); void nxagentWMDetect(void);
#ifdef XlibAtom #ifdef XlibAtom
......
...@@ -580,6 +580,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -580,6 +580,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
NXShadowDestroy(); NXShadowDestroy();
} }
saveAgentState("TERMINATED"); saveAgentState("TERMINATED");
nxagentFreeAtomMap();
#endif /* NXAGENT_SERVER */ #endif /* NXAGENT_SERVER */
KillAllClients(); KillAllClients();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment