Skip to content

Commit ab911a3

Browse files
committed
modify a test to avoid memory leak
1 parent c1651cd commit ab911a3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/tests/jf_test_12.F90

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ subroutine test_12(error_cnt)
150150
call json%get(me=root,path='array data.data',array_callback=get_3D_from_array)
151151
call check_errors(all(abs(fetched_array - reshape(raw_array,[size(raw_array)])) <= TOL))
152152

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

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

0 commit comments

Comments
 (0)