Close tslib device when the module is unloaded. Closes a memory leak and
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 25 Apr 2009 16:06:27 +0000 (16:06 +0000)
committerLars-Peter Clausen <lars@metafoo.de>
Sat, 25 Apr 2009 16:06:27 +0000 (16:06 +0000)
allows the device to be reopended when the xserver is restarted.

SVN-Revision: 15407

Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch [new file with mode: 0644]

diff --git a/Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch b/Xorg/driver/xf86-input-tslib/patches/020-close-tsdevice-when-module-is-uninitialized.patch
new file mode 100644 (file)
index 0000000..2af9111
--- /dev/null
@@ -0,0 +1,24 @@
+commit b6ff79c07806789a12ca3c5260c5d0b12e212eef
+Author: Lars-Peter Clausen <lars@metafoo.de>
+Date:   Sat Apr 25 18:00:09 2009 +0200
+
+    Close tslib device when the module is unloaded. Closes a memory leak and allows
+    the device to be reopended when the xserver is restarted.
+
+diff --git a/src/tslib.c b/src/tslib.c
+index 50596b7..e7a2766 100644
+--- a/src/tslib.c
++++ b/src/tslib.c
+@@ -286,10 +286,12 @@ xf86TslibControlProc(DeviceIntPtr device, int what)
+ static void
+ xf86TslibUninit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
+ {
++      struct ts_priv *priv = (struct ts_priv *)(pInfo->private);
+ #ifdef DEBUG
+       ErrorF("%s\n", __FUNCTION__);
+ #endif
+       xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
++      ts_close(priv->ts);
+       xfree(pInfo->private);
+     xf86DeleteInput(pInfo, 0);
+ }