The ejection of meteoroids from comets