After much digging into this it seems this is because ode gets closed before the space created by the touch sensor gets deleted. Will need to improve the pointer management here so we can make sure to delete the sensor before closing ode.