2af911118865abb047c3d9a8f0644880cf836079
[openwrt/svn-archive/archive.git] / Xorg / driver / xf86-input-tslib / patches / 020-close-tsdevice-when-module-is-uninitialized.patch
1 commit b6ff79c07806789a12ca3c5260c5d0b12e212eef
2 Author: Lars-Peter Clausen <lars@metafoo.de>
3 Date: Sat Apr 25 18:00:09 2009 +0200
4
5 Close tslib device when the module is unloaded. Closes a memory leak and allows
6 the device to be reopended when the xserver is restarted.
7
8 diff --git a/src/tslib.c b/src/tslib.c
9 index 50596b7..e7a2766 100644
10 --- a/src/tslib.c
11 +++ b/src/tslib.c
12 @@ -286,10 +286,12 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
13 static void
14 xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
15 {
16 + struct ts_priv *priv = (struct ts_priv *)(pInfo->private);
17 #ifdef DEBUG
18 ErrorF("%s\n", __FUNCTION__);
19 #endif
20 xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
21 + ts_close(priv->ts);
22 xfree(pInfo->private);
23 xf86DeleteInput(pInfo, 0);
24 }