On 01/05/2011 10:12 PM, Peter Hutterer wrote: > 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 <[email protected]> > --- > bit of an oversight in the first patchset... > > dix/inpututils.c | 8 ++++++++ > include/input.h | 1 + > test/input.c | 3 ++- > 3 files changed, 11 insertions(+), 1 deletions(-) > > diff --git a/dix/inpututils.c b/dix/inpututils.c > index 2877804..ef3142c 100644 > --- a/dix/inpututils.c > +++ b/dix/inpututils.c > @@ -433,6 +433,14 @@ valuator_mask_new(int num_valuators) > return mask; > } > > +void > +valuator_mask_free(ValuatorMask **mask) > +{ > + free(*mask); > + *mask = NULL; > +}
I'm curious why not just a single pointer like traditional free(), leaving the task of setting the pointer to NULL to the caller? -- Chase _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
