From e950c52067022c656ebb0b18edb89e1da57b5ec2 Mon Sep 17 00:00:00 2001 From: nhorelik Date: Sun, 5 May 2013 18:51:22 -0400 Subject: [PATCH] Fixed plotting memory leak and added rxnplot flag --- src/global.F90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/global.F90 b/src/global.F90 index af20c135af..83e31758e7 100644 --- a/src/global.F90 +++ b/src/global.F90 @@ -249,6 +249,9 @@ module global ! Mode to run in (fixed source, eigenvalue, plotting, etc) integer :: run_mode = NONE + + ! Flag for reaction rate plotting + logical :: rxn_plots = .false. ! Restart run logical :: restart_run = .false. @@ -391,8 +394,16 @@ contains if (allocated(lattices)) deallocate(lattices) if (allocated(surfaces)) deallocate(surfaces) if (allocated(materials)) deallocate(materials) - if (allocated(plots)) deallocate(plots) + ! Deallocate plots + + if (allocated(plots)) then + do i = 1, size(plots) + if allocated(plots(i) % colors) deallocate(plots(i) % colors) + if allocated(plots(i) % rxncnt) deallocate(plots(i) % rxncnt) + end do + deallocate(plots) + end if ! Deallocate cross section data, listings, and cache if (allocated(nuclides)) then ! First call the clear routines