diff --git a/opm/core/GridManager.cpp b/opm/core/GridManager.cpp index fba9253c..1d8cc720 100644 --- a/opm/core/GridManager.cpp +++ b/opm/core/GridManager.cpp @@ -109,7 +109,7 @@ namespace Opm /// Destructor. GridManager::~GridManager() { - free_grid(ug_); + destroy_grid(ug_); } diff --git a/opm/core/grid.c b/opm/core/grid.c index c66f401a..ae7161a8 100644 --- a/opm/core/grid.c +++ b/opm/core/grid.c @@ -20,7 +20,7 @@ #include #include -void free_grid(struct UnstructuredGrid *g) +void destroy_grid(struct UnstructuredGrid *g) { if (g!=NULL) { diff --git a/opm/core/grid.h b/opm/core/grid.h index 3fa5aa83..e7414109 100644 --- a/opm/core/grid.h +++ b/opm/core/grid.h @@ -57,7 +57,7 @@ struct UnstructuredGrid { }; -void free_grid(struct UnstructuredGrid *g); +void destroy_grid(struct UnstructuredGrid *g); #ifdef __cplusplus diff --git a/opm/core/grid/cart_grid.c b/opm/core/grid/cart_grid.c index 2edcfaf0..6465279f 100644 --- a/opm/core/grid/cart_grid.c +++ b/opm/core/grid/cart_grid.c @@ -218,7 +218,7 @@ allocate_cart_grid_3d(int nx, int ny, int nz) (G->cell_centroids == NULL ) || (G->cell_volumes == NULL ) ) { - free_grid(G); + destroy_grid(G); G = NULL; } } @@ -553,7 +553,7 @@ allocate_cart_grid_2d(int nx, int ny) (G->cell_centroids == NULL ) || (G->cell_volumes == NULL ) ) { - free_grid(G); + destroy_grid(G); G = NULL; } } diff --git a/opm/core/grid/cornerpoint_grid.c b/opm/core/grid/cornerpoint_grid.c index 7a4c4114..89107462 100644 --- a/opm/core/grid/cornerpoint_grid.c +++ b/opm/core/grid/cornerpoint_grid.c @@ -181,7 +181,7 @@ preprocess (const struct grdecl *in, double tol) * * In particular, convey resource ownership from 'pg' to 'g'. * Consequently, memory resources obtained in process_grdecl() - * will be released in free_grid(). + * will be released in destroy_grid(). */ g->dimensions = 3; @@ -204,7 +204,7 @@ preprocess (const struct grdecl *in, double tol) pg.face_neighbors = NULL; /* Initialise subsequently allocated fields to a defined state lest - * we free() random pointers in free_grid() if either of the + * we free() random pointers in destroy_grid() if either of the * fill_cell_topology() or allocate_geometry() functions fail. */ g->face_centroids = NULL; g->face_normals = NULL; @@ -222,7 +222,7 @@ preprocess (const struct grdecl *in, double tol) if (!ok) { - free_grid(g); + destroy_grid(g); g = NULL; } else diff --git a/tests/test_cartgrid.cpp b/tests/test_cartgrid.cpp index afbdc77b..e6e61f56 100644 --- a/tests/test_cartgrid.cpp +++ b/tests/test_cartgrid.cpp @@ -35,6 +35,6 @@ int main(void) } fprintf(stderr, "\n"); } - free_grid(g); + destroy_grid(g); return 0; } diff --git a/tests/test_readvector.cpp b/tests/test_readvector.cpp index 279e93f7..dfc4a98a 100644 --- a/tests/test_readvector.cpp +++ b/tests/test_readvector.cpp @@ -61,7 +61,7 @@ int main() g = read_grid(std::string("example")); - free_grid(g); + destroy_grid(g); return 0; }