diff --git a/dix/grabs.c b/dix/grabs.c index c28356d9b..3b07186ea 100644 --- a/dix/grabs.c +++ b/dix/grabs.c @@ -180,6 +180,14 @@ UngrabAllDevices(Bool kill_client) ErrorF("End list of ungrabbed devices\n"); } +GrabPtr +AllocGrab(void) +{ + GrabPtr grab = calloc(1, sizeof(GrabRec)); + + return grab; +} + GrabPtr CreateGrab( int client, @@ -196,7 +204,7 @@ CreateGrab( { GrabPtr grab; - grab = calloc(1, sizeof(GrabRec)); + grab = AllocGrab(); if (!grab) return (GrabPtr)NULL; grab->resource = FakeClientID(client); @@ -226,7 +234,7 @@ CreateGrab( } -static void +void FreeGrab(GrabPtr pGrab) { free(pGrab->modifiersDetail.pMask); diff --git a/include/dixgrabs.h b/include/dixgrabs.h index 229c8bb53..2ed8a54b4 100644 --- a/include/dixgrabs.h +++ b/include/dixgrabs.h @@ -31,6 +31,9 @@ struct _GrabParameters; extern void PrintDeviceGrabInfo(DeviceIntPtr dev); extern void UngrabAllDevices(Bool kill_client); +extern GrabPtr AllocGrab(void); +extern void FreeGrab(GrabPtr grab); + extern GrabPtr CreateGrab( int /* client */, DeviceIntPtr /* device */,