Fixed crashing on closing for 2d physics samples