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)
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.
......
......@@ -51,6 +51,8 @@ int nxagentQueryAtoms(ScreenPtr pScreen);
void nxagentResetAtomMap(void);
void nxagentFreeAtomMap(void);
void nxagentWMDetect(void);
#ifdef XlibAtom
......
......@@ -580,6 +580,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
NXShadowDestroy();
}
saveAgentState("TERMINATED");
nxagentFreeAtomMap();
#endif /* NXAGENT_SERVER */
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