From 0df290f3a33473efeefc5d8e16764ee12adb9e89 Mon Sep 17 00:00:00 2001 From: shriwise Date: Fri, 23 Feb 2018 11:22:12 -0600 Subject: [PATCH] Adding a deallocation method for CAD pointer. --- src/cad.cpp | 5 +++++ src/cad.h | 1 + src/cad_header.F90 | 12 ++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/cad.cpp b/src/cad.cpp index 90b325866..58eeeff48 100644 --- a/src/cad.cpp +++ b/src/cad.cpp @@ -41,3 +41,8 @@ void load_cad_geometry_c() return; } + +void dealloc_cad_c() +{ + delete DAGMC; +} diff --git a/src/cad.h b/src/cad.h index f88c4be3f..c3dc49715 100644 --- a/src/cad.h +++ b/src/cad.h @@ -6,5 +6,6 @@ #include "surface.h" extern "C" void load_cad_geometry_c(); +extern "C" void dealloc_cad_c(); #endif // CAD_H diff --git a/src/cad_header.F90 b/src/cad_header.F90 index 91176eaf9..1fc6dbf16 100644 --- a/src/cad_header.F90 +++ b/src/cad_header.F90 @@ -8,12 +8,20 @@ module cad_header interface subroutine load_cad_geometry_c() bind(C) end subroutine load_cad_geometry_c + + subroutine dealloc_cad_c() bind(C) + end subroutine dealloc_cad_c + end interface - + contains subroutine load_cad_geometry() call load_cad_geometry_c() end subroutine load_cad_geometry - + + subroutine dealloc_cad() + call dealloc_cad_c() + end subroutine dealloc_cad + end module cad_header