summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2008-09-11 00:35:49 +0200
committerPeter Hutterer <peter.hutterer@redhat.com>2008-09-17 12:19:03 +0930
commitc916f66af51e2a5b954d62ff2b6bf854895eeeb5 (patch)
tree8df6d0424f35837981c0eed6b91a4674e77e76d0
parent31f85fb3c1d1f5b2171255fdb565cb5911806ba9 (diff)
Introduce SynapticsUnInit
This patch adds the UnInit function, which explicitly cleans up the allocated device. It also prepares for a distinction between closing-and-reopening a device, and shutting down X. This distinction makes it possible to better keep shared information alive. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
-rw-r--r--src/synaptics.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 1f96cc3..ddd614e 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -112,6 +112,7 @@ typedef enum {
* Forward declaration
****************************************************************************/
static InputInfoPtr SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags);
+static void SynapticsUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
static Bool DeviceControl(DeviceIntPtr, int);
static void ReadInput(LocalDevicePtr);
static int HandleState(LocalDevicePtr, struct SynapticsHwState*);
@@ -135,7 +136,7 @@ InputDriverRec SYNAPTICS = {
"synaptics",
NULL,
SynapticsPreInit,
- NULL,
+ SynapticsUnInit,
NULL,
0
};
@@ -570,6 +571,20 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
return local;
}
+
+/*
+ * Uninitialize the device.
+ */
+static void SynapticsUnInit(InputDriverPtr drv,
+ InputInfoPtr local,
+ int flags)
+{
+ xfree(local->private);
+ local->private = NULL;
+ xf86DeleteInput(local, 0);
+}
+
+
/*
* Alter the control parameters for the mouse. Note that all special
* protocol values are handled by dix.