-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
My Code is quit simple:
// a toml string
var tomlString = '''
port = 6789
socks_port = 7890
allow_lan = false
bind_address = '*'
log_level = 'debug'
ipv6 = false
tun_fd = 0
'''
// `NetspeedConfig` is a Swift Struct define in my app
var config = try TOMLDecoder().decode(NetspeedConfig.self, from: tomlString)
// set property etc.
config.tun_fd = 10
...
// convert to toml string
tomlString = try TOMLEncoder().encode(config)
// create a TOMLKit table
let table = try TOMLTable(string: tomlString)
// convert to strings
let output_toml = table.convert(to: .toml)
let output_json = table.convert(to: .json)
let output_yaml = table.convert(to: .yaml)

Xcode Instruments catch this memory leak, please download it and check in Xcode
https://github.com/codingiran/TOMLKit/blob/main/MemoryLeaks/TOMlKit%20Memory%20Leaks.trace.zip
Metadata
Metadata
Assignees
Labels
No labels