summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-02-27 17:17:41 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-07 09:40:51 +1000
commit6f44d672aa34d343f63f0ea81ad58154a66b57ec (patch)
tree3c9ef17c93eaa7021e0e132d3a0cc2ab0334df63
parent623981ddaeb8836f3b0939e527c0e943f9c4e974 (diff)
xkb: free XkbRulesUsed and XkbRulesDflt on extension cleanup
==2547== 1 bytes in 1 blocks are still reachable in loss record 1 of 111 ==2547== at 0x4C2A4CD: malloc (vg_replace_malloc.c:236) ==2547== by 0x64D1551: strdup (strdup.c:43) ==2547== by 0x4802FB: Xstrdup (utils.c:1113) ==2547== by 0x585B6C: XkbSetRulesUsed (xkbInit.c:219) ==2547== by 0x58700F: InitKeyboardDeviceStruct (xkbInit.c:595) ==2547== by 0x419FA3: vfbKeybdProc (InitInput.c:74) ==2547== by 0x425A3D: ActivateDevice (devices.c:540) ==2547== by 0x425F65: InitAndStartDevices (devices.c:713) ==2547== by 0x5ACA57: main (main.c:259) and a few more of the above. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com>
-rw-r--r--dix/devices.c1
-rw-r--r--include/xkbsrv.h3
-rw-r--r--xkb/xkbInit.c15
3 files changed, 19 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c
index fa94a9438..0c718d204 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -1052,6 +1052,7 @@ CloseDownDevices(void)
inputInfo.pointer = NULL;
XkbDeleteRulesDflts();
+ XkbDeleteRulesUsed();
OsReleaseSignals();
}
diff --git a/include/xkbsrv.h b/include/xkbsrv.h
index 45e2e8c47..346ebccf0 100644
--- a/include/xkbsrv.h
+++ b/include/xkbsrv.h
@@ -751,6 +751,9 @@ extern _X_EXPORT void XkbSetRulesDflts(XkbRMLVOSet * /* rmlvo */
extern _X_EXPORT void XkbDeleteRulesDflts(void
);
+extern _X_EXPORT void XkbDeleteRulesUsed(void
+ );
+
extern _X_EXPORT int SProcXkbDispatch(ClientPtr /* client */
);
diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 4e8e267da..244c353c6 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -251,6 +251,21 @@ XkbSetRulesDflts(XkbRMLVOSet * rmlvo)
}
void
+XkbDeleteRulesUsed(void)
+{
+ free(XkbRulesUsed);
+ XkbRulesUsed = NULL;
+ free(XkbModelUsed);
+ XkbModelUsed = NULL;
+ free(XkbLayoutUsed);
+ XkbLayoutUsed = NULL;
+ free(XkbVariantUsed);
+ XkbVariantUsed = NULL;
+ free(XkbOptionsUsed);
+ XkbOptionsUsed = NULL;
+}
+
+void
XkbDeleteRulesDflts(void)
{
free(XkbRulesDflt);