Skip to content

Commit

Permalink
TokaMaker: fix SEGFAULT in TokaMaker.reset() with some grids
Browse files Browse the repository at this point in the history
  • Loading branch information
hansec committed Jul 8, 2024
1 parent 1155a06 commit 574a2d9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/physics/grad_shaf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5617,14 +5617,16 @@ subroutine gs_destroy(self)
IF(self%ncoil_regs>0)THEN
DO i=1,self%ncoil_regs
IF(ASSOCIATED(self%coil_regions(i)%lc))DEALLOCATE(self%coil_regions(i)%lc)
IF(ASSOCIATED(self%psi_coil(i)%f))CALL self%psi_coil(i)%f%delete()
END DO
DEALLOCATE(self%coil_regions,self%psi_coil)
DEALLOCATE(self%coil_regions)
self%ncoil_regs=0
END IF
!---
IF(self%ncoils>0)THEN
DEALLOCATE(self%coil_currs,self%coil_vcont,self%coil_nturns)
DO i=1,self%ncoils
IF(ASSOCIATED(self%psi_coil(i)%f))CALL self%psi_coil(i)%f%delete()
END DO
DEALLOCATE(self%psi_coil,self%coil_currs,self%coil_vcont,self%coil_nturns)
self%ncoils=0
END IF
!---
Expand Down

0 comments on commit 574a2d9

Please sign in to comment.