device: unset the axes array pointer when resetting

Otherwise we'll get a nice realloc() error from glibc.
This commit is contained in:
Emmanuele Bassi 2011-01-21 14:12:19 +00:00
parent 0e99346915
commit 7a339d1663

View File

@ -975,6 +975,7 @@ _clutter_input_device_reset_axes (ClutterInputDevice *device)
if (device->axes != NULL)
{
g_array_free (device->axes, TRUE);
device->axes = NULL;
g_object_notify_by_pspec (G_OBJECT (device), obj_props[PROP_N_AXES]);
}
@ -1025,6 +1026,7 @@ _clutter_input_device_add_axis (ClutterInputDevice *device,
default:
info.min_axis = 0;
info.max_axis = 1;
break;
}
device->axes = g_array_append_val (device->axes, info);