-
-
Notifications
You must be signed in to change notification settings - Fork 374
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 leak fix in curl bindings #1856
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this makes sense. Thanks!
Issue 2313 might be related to this. |
@trnzk Unfortunately there is a leak in the png implementation :( I took this image from my 5 minute game session. The functions that cause leakage are as follows; lime/project/src/graphics/format/PNG.cpp Line 296 in 3d10ea7
lime/project/src/graphics/format/PNG.cpp Line 228 in 3d10ea7
lime/project/src/graphics/format/PNG.cpp Line 236 in 3d10ea7
|
Sorry for misinformation, this leak is related to png encode, probably curl fix will fix the leak mentioned. |
My tests still confirm a memory leak. lime::header_callback(void*, unsigned long, unsigned long, void*) |
Please remove following lines to fix memory leak. lime/project/src/net/curl/CURLBindings.cpp Line 599 in 190d1d3
lime/project/src/net/curl/CURLBindings.cpp Line 706 in 190d1d3
|
Removing these lines will change the purpose of the function; it would be more appropriate to use the free_header_values function before 'clear'. I don’t have the opportunity to test it right now, but if you try it this way and let me know the result, I’d appreciate it. |
Changing these lines does not affect the purpose or behavior of the function, in fact it creates the behavior it should have. If you empty the vector, the free_header_values function is useless because it always tries to freeing the empty vector. also writing free under alloc_string doesn't work because alloc_string is just casting and the same pointer will still be used. |
No description provided.