diff options
author | Rami Ylimäki <rami.ylimaki@vincit.fi> | 2011-03-08 11:23:45 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-03-09 15:23:39 +1000 |
commit | 50193a0dd35b6f54499fb76ab68f615237cc51f9 (patch) | |
tree | 9f073dca13f24a1d7ca9227113bf76ab00960f91 /src/evdev.c | |
parent | 0049cce4d0691f055dfe9059e4c0c4ad30301db6 (diff) |
Release leaked XKB options on input device disconnect.
Currently the XKB options duplicated in EvdevAddKeyClass are never
released. For example, connecting and disconnecting a bluetooth
keyboard repeatedly causes a steadily growing memory leak.
Signed-off-by: Rami Ylimäki <rami.ylimaki@vincit.fi>
Reviewed-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c index 519a50e..679df38 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1826,6 +1826,18 @@ EvdevOpenDevice(InputInfoPtr pInfo) return Success; } +static void +EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) +{ + EvdevPtr pEvdev = pInfo ? pInfo->private : NULL; + if (pEvdev) + { + /* Release strings allocated in EvdevAddKeyClass. */ + XkbFreeRMLVOSet(&pEvdev->rmlvo, FALSE); + } + xf86DeleteInput(pInfo, flags); +} + static int EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) { @@ -1897,7 +1909,7 @@ _X_EXPORT InputDriverRec EVDEV = { "evdev", NULL, EvdevPreInit, - NULL, + EvdevUnInit, NULL, evdevDefaults }; |