input: add valuator_mask_free() to free a valuator mask.
Expecting the caller to free the mask requires us to keep it in a single memory block (which may be an issue lateron), aside from leaving the API asymetrical. Provide valuator_mask_free() to free the memory and reset the mask pointer to NULL. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Fernando Carrijo <fcarrijo@freedesktop.org> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
@@ -433,6 +433,14 @@ valuator_mask_new(int num_valuators)
|
||||
return mask;
|
||||
}
|
||||
|
||||
void
|
||||
valuator_mask_free(ValuatorMask **mask)
|
||||
{
|
||||
free(*mask);
|
||||
*mask = NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets a range of valuators between first_valuator and num_valuators with
|
||||
* the data in the valuators array. All other values are set to 0.
|
||||
|
||||
Reference in New Issue
Block a user