Skip to content

Commit

Permalink
Merge pull request #227 from openmopac/stray-disk-access
Browse files Browse the repository at this point in the history
Delay null file handle closure until after post-processing
  • Loading branch information
godotalgorithm authored Nov 17, 2024
2 parents c92b082 + cd9b9aa commit c44737d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/interface/mopac_api_finalize.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ module subroutine mopac_finalize(properties)
integer :: status, i, j, size
type(c_ptr), allocatable :: pptr(:)

! close dummy output file to free up /dev/null
close(iw)

! record properties
if (.not. moperr) call mopac_record(properties)

! close dummy output file to free up /dev/null
close(iw)

! collect error messages & assign NULL pointers for memory safety
if (moperr) then
properties%charge = c_null_ptr
Expand Down

0 comments on commit c44737d

Please sign in to comment.