recursive subroutine fson_value_destroy(this)
use fson_string_m, only: fson_string_destroy
implicit none
type(fson_value), pointer :: this
if (associated(this % children)) then
call fson_value_destroy(this % children)
nullify(this % children)
end if
if (associated(this % next)) then
call fson_value_destroy(this % next)
nullify (this % next)
end if
if (associated(this % name)) then
call fson_string_destroy(this % name)
nullify (this % name)
end if
if (associated(this % value_string)) then
call fson_string_destroy(this % value_string)
nullify (this % value_string)
end if
nullify(this)
end subroutine fson_value_destroy