dix: Add FreeDeviceClass and FreeFeedbackClass for centralised xfree.

Ensures that we only have one way of freeing a device class to avoid leaks in
ChangeMasterDeviceClasses and other places.
This commit is contained in:
Peter Hutterer
2007-11-15 15:43:44 +10:30
parent 18833d648f
commit b40646dc10
4 changed files with 190 additions and 123 deletions

View File

@@ -84,6 +84,7 @@ typedef unsigned long Leds;
typedef struct _OtherClients *OtherClientsPtr;
typedef struct _InputClients *InputClientsPtr;
typedef struct _DeviceIntRec *DeviceIntPtr;
typedef struct _ClassesRec *ClassesPtr;
typedef struct _EventList {
xEvent* event;
@@ -484,6 +485,9 @@ extern int AllocMasterDevice(char* name,
DeviceIntPtr* keybd);
extern void DeepCopyDeviceClasses(DeviceIntPtr from,
DeviceIntPtr to);
extern void FreeDeviceClass(int type, pointer* class);
extern void FreeFeedbackClass(int type, pointer* class);
extern void FreeAllDeviceClasses(ClassesPtr classes);
/* Window/device based access control */
extern Bool ACRegisterClient(ClientPtr client);