close the file on return. See https://github.com/ceres-solver/ceres-solver/issues/425 Change-Id: I7d02a07d36608c25db191de31f47f19b33962040
diff --git a/internal/ceres/bundle_adjustment_test_util.h b/internal/ceres/bundle_adjustment_test_util.h index 0926204..7e076eb 100644 --- a/internal/ceres/bundle_adjustment_test_util.h +++ b/internal/ceres/bundle_adjustment_test_util.h
@@ -128,6 +128,8 @@ for (int i = 0; i < num_parameters_; ++i) { FscanfOrDie(fptr, "%lf", parameters_ + i); } + + fclose(fptr); } void BuildProblem() { @@ -142,7 +144,7 @@ new BundlerResidual(observations_[2*i + 0], observations_[2*i + 1])); - // Each observation correponds to a pair of a camera and a point + // Each observation corresponds to a pair of a camera and a point // which are identified by camera_index()[i] and // point_index()[i] respectively. double* camera = cameras + 9 * camera_index_[i];