Fixed memory leak when using random cones