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

tutorial06中有关内存回收 #220

Open
adskjldjlska opened this issue Mar 15, 2022 · 1 comment
Open

tutorial06中有关内存回收 #220

adskjldjlska opened this issue Mar 15, 2022 · 1 comment

Comments

@adskjldjlska
Copy link

在解决有关内存泄漏的问题中,我发现lept_parse_object函数中的m临时变量下也malloc了内存空间,但是在给出的答案中并没有对m分配的空间进行了释放,而且当我加上free(m.k)之后,在VS studio中会报错,或是某些测试不通过如不能获取键值,键值的内容为空。我想问一下m的空间不需要释放吗

@adskjldjlska
Copy link
Author

answer中也给出了free(m.k)但是是在整个for循环后,这种情况只能处理解析不符合语法的Object,解析符合语法的object时,就根本不会用到

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