Skip to content

Commit

Permalink
modify a test to avoid memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwilliams committed Jun 1, 2024
1 parent c1651cd commit ab911a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/tests/jf_test_12.F90
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,10 @@ subroutine test_12(error_cnt)
call json%get(me=root,path='array data.data',array_callback=get_3D_from_array)
call check_errors(all(abs(fetched_array - reshape(raw_array,[size(raw_array)])) <= TOL))

my_file = json_file(root,verbose=.true.,real_format='G')

call json%destroy(root)
!my_file = json_file(root,verbose=.true.,real_format='G') ! valgrind says this cases a memory leak
call my_file%initialize(verbose=.true.,real_format='G') ! this doesn't have a memmory leak
call my_file%add(root)
nullify(root)

call my_file%update('array data.description',CK_'vector data',found=existed)
call check_file_errors(existed)
Expand Down

0 comments on commit ab911a3

Please sign in to comment.