Skip to content

Commit

Permalink
fix(lak,sfr,uzf): fix nullptr when deallocating package in validate m…
Browse files Browse the repository at this point in the history
…ode (#1331)

Co-authored-by: mjreno <[email protected]>
  • Loading branch information
mjreno and mjreno authored Aug 21, 2023
1 parent 78411ba commit c9d861f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 5 additions & 3 deletions src/Model/GroundWaterFlow/gwf3lak8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4644,9 +4644,11 @@ subroutine lak_da(this)
!
! -- package csv table
if (this%ipakcsv > 0) then
call this%pakcsvtab%table_da()
deallocate (this%pakcsvtab)
nullify (this%pakcsvtab)
if (associated(this%pakcsvtab)) then
call this%pakcsvtab%table_da()
deallocate (this%pakcsvtab)
nullify (this%pakcsvtab)
end if
end if
!
! -- scalars
Expand Down
8 changes: 5 additions & 3 deletions src/Model/GroundWaterFlow/gwf3sfr8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2704,9 +2704,11 @@ subroutine sfr_da(this)
!
! -- deallocate package csv table
if (this%ipakcsv > 0) then
call this%pakcsvtab%table_da()
deallocate (this%pakcsvtab)
nullify (this%pakcsvtab)
if (associated(this%pakcsvtab)) then
call this%pakcsvtab%table_da()
deallocate (this%pakcsvtab)
nullify (this%pakcsvtab)
end if
end if
!
! -- deallocate scalars
Expand Down
8 changes: 5 additions & 3 deletions src/Model/GroundWaterFlow/gwf3uzf8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2796,9 +2796,11 @@ subroutine uzf_da(this)
!
! -- package csv table
if (this%ipakcsv > 0) then
call this%pakcsvtab%table_da()
deallocate (this%pakcsvtab)
nullify (this%pakcsvtab)
if (associated(this%pakcsvtab)) then
call this%pakcsvtab%table_da()
deallocate (this%pakcsvtab)
nullify (this%pakcsvtab)
end if
end if
!
! -- deallocate scalars
Expand Down

0 comments on commit c9d861f

Please sign in to comment.