Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leaks on iOS TOMLTable.convert(to:options:) #26

Open
codingiran opened this issue Jan 9, 2024 · 0 comments
Open

Memory Leaks on iOS TOMLTable.convert(to:options:) #26

codingiran opened this issue Jan 9, 2024 · 0 comments

Comments

@codingiran
Copy link

codingiran commented Jan 9, 2024

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)
iShot_2024-01-09_16 46 58

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

@codingiran codingiran changed the title Memory Leaks on iOS on TOMLTable.convert(to:options:) Memory Leaks on iOS TOMLTable.convert(to:options:) Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant