2010-10-06, 03:20
I am trying to get my head around the code base, and I started by running Valgrind on R34478. I picked out some of the larger memory leaks to go after, and found one in the CURL code. Specifically in the file DllLibCurl.cpp, there are calls to the libcurl function curl_multi_init() which do not have matching calls to curl_multi_cleanup(). This causes a memory leak.
You will notice that curl_multi_cleanup() is only called when a session goes idle (CheckIdle() method). That means all non-idle sessions are left open when xbmc exits, leaking memory to the OS.
Anyone familiar with the code in question, particularly DllLibCurl.cpp and FileCurl.cpp that can help me figure out a fix? I added code to the destructor to release the memory, which works - but might not be the best solution.
You will notice that curl_multi_cleanup() is only called when a session goes idle (CheckIdle() method). That means all non-idle sessions are left open when xbmc exits, leaking memory to the OS.
Anyone familiar with the code in question, particularly DllLibCurl.cpp and FileCurl.cpp that can help me figure out a fix? I added code to the destructor to release the memory, which works - but might not be the best solution.